Fatal error: memory size

Fatal error: memory size

by Muff Stuff -
Number of replies: 8

Hi all,

i ahve been trying to create a backup and restore functionality for a custom modue, and altough it seems quite simple, after i add the:

$this->add_step(new backup_moduçe_activity_structure_step('module_structure', 'module.xml'));

in the define_my_settings() function, after that i get th:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 523800 bytes) in /home/muffles/public_html/moodle/backup/util/helper/backup_general_helper.class.php on line 190

error. I have tried to remove everything from the stepslib file, in the define_structure function, and it still returns that error. I have no idea what is wrong.

 

I have increased the memory_limit, cleared caches, etc, nothing worked...This is actualy not doing anything atm so...

PS: Using moodle 2.0

 

Thank you

Average of ratings: -
In reply to Muff Stuff

Re: Fatal error: memory size

by Stuart Morrison -

Hi

You have mentioned memory_limit. Have you also increased post_max_size (and upload_max_filesize; although as it is on your server this should not be as necessary)?

In reply to Stuart Morrison

Re: Fatal error: memory size

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Perhaps you might be better off posting this in the Developer's forum - you think?

In reply to Colin Fraser

Re: Fatal error: memory size

by Stuart Morrison -

Possibly; although I did also think that it might help other people who have a similar problem when they backup any course e.g. http://moodle.org/mod/forum/discuss.php?d=187816&parent=819406

I did not suggest to Mahtab to increase his post_max_size (didn't think of it then) if he bumps his post or googles (if he has not found a solution) it might help (which is why I also added the bit about upload_max_filesize).

Might be something to update in the FAQ (if increasing these php values does help):

http://docs.moodle.org/20/en/Errors_FAQ#Fatal_error_allowed_memory_size_exhausted._How_do_I_increase_my_php_memory_limit.3F

 

 

In reply to Stuart Morrison

Re: Fatal error: memory size

by Jessica Welsh -

I am having this same issue. I cannot restore anything. 

 

Any advice?

In reply to Jessica Welsh

Re: Fatal error: memory size

by Simon Luhur -

Have you tried increasing memory limit by going to Site Administration - Server - Performance. By default is 128mb and you can increase up to 1024mb.

In reply to Simon Luhur

Re: Fatal error: memory size

by Jessica Welsh -

Thank you for responding! 

Yes, I did increase the limit at that location to 1024 - I'm still getting the error. cURL and bitrate are set to defaults of 120 and 56 respectively. 

I cleared cache just in case it helped with anything (I'll pull at straws!). 

I also had tried the information on the Back Up FAQ page - about using the .htaccess file and the php.ini file. Changing the php.ini file also did not seem to do anything; and for some reason if I have an .htaccess file at all, it bombs the site (no access at all), so I was not able to do anything there. 

Is there something else I can try? 

 

Oh. I am on 2.1.1 - and have not made any changes since the last time I ran back-up/restore and import, which all worked fine at that time. 

In reply to Jessica Welsh

Re: Fatal error: memory size

by Simon Luhur -

Probably try turn debugging on and see what error message you get. From my experience, some of the third party modules or blocks may cause the backup/restore process to stall.

In reply to Simon Luhur

Re: Fatal error: memory size

by Jessica Welsh -

I turned debugging on before I searched/posted for help smile 

 

Fatal error: memory size - various files depending if I'm trying to install or import. 

 

Now, when I go to create a new course from back-up, it gets to the last screen and goes blank (except for the error messages - it says it doesn't want to add the Paypal info, then also gives the "Fatal error: memory size" - EXCEPT it does add that new course.)

 

(for the record, it has never added the paypal info automatically - no matter what/when; so now I see it was a minor error and perhaps it was supposed to be adding all along - but that does not seem to be what is breaking anything)

 

I have done no updates, adding mods, etc since this past October when I last tried to restoring from back-ups. NOTHING has changed on my end, except the size of the back-ups.