OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Reaching memory limit during upgrade

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Reaching memory limit during upgrade

Postby agentsmith » Wed May 29, 2013 1:40 pm

Hello,

The php memory limit on the server is set to 512M.

During the upgrade of OJS 2.3.4 to 2.4.2 using php CLI upgrade method I get the following error:

[data: dbscripts/xml/upgrade/2.4.0_update.xml]
[code: Installer Installer::migrateNotifications]
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 133 bytes) in /var/www/sites/ejournals/docroot/lib/pkp/lib/adodb/adodb.inc.php on line 819

I assume that this error has to do with the notification table? the size of our table is over 310,000 records

Should I just keep increasing the memory limit (which I already think is quite high) or is there a better way?

Thanks
Jeremy
agentsmith
 
Posts: 40
Joined: Fri Sep 15, 2006 4:40 pm

Re: Reaching memory limit during upgrade

Postby asmecher » Wed May 29, 2013 1:49 pm

Hi Jeremy,

We recently found a memory leak that might cause this; try applying https://github.com/pkp/pkp-lib/commit/06bc11f5ecfb25ceffd612a3e7c8aef193c21903.diff, restoring your DB from backup, and running the upgrade again. (You'll have to apply this from the lib/pkp subdirectory.)

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9099
Joined: Wed Aug 10, 2005 12:56 pm

Re: Reaching memory limit during upgrade

Postby agentsmith » Thu May 30, 2013 7:57 am

Thanks Alec

It worked!

Jeremy
agentsmith
 
Posts: 40
Joined: Fri Sep 15, 2006 4:40 pm

Re: Reaching memory limit during upgrade

Postby asmecher » Thu May 30, 2013 9:31 am

Hi Jeremy,

Excellent! Glad to hear it.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9099
Joined: Wed Aug 10, 2005 12:56 pm

Re: Reaching memory limit during upgrade

Postby Oberdan » Thu Nov 28, 2013 8:33 am

Hello,

I'm having the same problem upgrading from 2.3.7 to 2.4.2, tried the patch and got the following:

[ojs@portal pkp]$ patch -p1 < leak.diff
patching file classes/plugins/HookRegistry.inc.php
Hunk #1 FAILED at 68.
Hunk #2 FAILED at 97.
2 out of 2 hunks FAILED -- saving rejects to file classes/plugins/HookRegistry.inc.php.rej
can't find file to patch at input line 76
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/tests/classes/core/PKPRequestTest.php b/tests/classes/core/PKPRequestTest.php
|index c38159f..a0a2eee 100644
|--- a/tests/classes/core/PKPRequestTest.php
|+++ b/tests/classes/core/PKPRequestTest.php
--------------------------
File to patch:

Any suggestions?

Thanks,

Oberdan
Oberdan
 
Posts: 5
Joined: Fri Jun 19, 2009 6:48 am

Re: Reaching memory limit during upgrade

Postby asmecher » Thu Nov 28, 2013 10:11 am

Hi Oberdan,

Don't worry about the parts of the patch that relate to files in the test/ subdirectory -- the tests don't ship with OJS. The important change is the one made to HookRegistry.inc.php; if the patch doesn't want to apply -- this could be for a number of reasons, such as line endings -- you might try merging it manually since it's so short.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9099
Joined: Wed Aug 10, 2005 12:56 pm

Re: Reaching memory limit during upgrade

Postby Oberdan » Fri Dec 20, 2013 8:30 am

Hello Alec,

Tried to patch the file manually, and it worked.

Thanks,

Oberdan
Oberdan
 
Posts: 5
Joined: Fri Jun 19, 2009 6:48 am

Re: Reaching memory limit during upgrade

Postby nomadit » Tue Mar 25, 2014 5:35 pm

I am having the same problem when upgrading from 2.2.3 to 2.4.3. The upgrade script gives this error :
Allowed memory size of 94371840 bytes exhausted (tried to allocate 40961 bytes) in /lib/pkp/lib/phputf8/utils/ascii.php on line 94

I applied the patch to the HookRegistry.inc.php, see attached.

I am trying to upgrade an old database to a fresh install as recommended. In case there was anything wrong with the old data, I did this as a test.

1. installed a new version OJS 2.2.3 so that I had a clean empty version of the 2.2.3 database
2. I then linked the 2.4.3 install to this clean 2.2.3 database.
3. I then ran the upgrade script to upgrade this completely empty database
4. Again I got the memory error at exactly the same point in the upgrade as when running the upgrade on the old populated database.

This is where the error occurs:
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
Allowed memory size of 94371840 bytes exhausted (tried to allocate 40961 bytes) in /home/teach_anth/teachinganthropology.org/lib/pkp/lib/phputf8/utils/ascii.php on line 94

Any suggestions?
nomadit
 
Posts: 6
Joined: Tue Mar 25, 2014 5:17 pm

Re: Reaching memory limit during upgrade

Postby asmecher » Wed Mar 26, 2014 7:22 am

Hi nomadit,

Which patch did you apply? I don't see anything attached.

Two things to try before restoring the database and running the upgrade again:
1. Turn off charset_normalization in your config.inc.php file. This will decrease memory usage and is almost certainly not useful on a modern server.
2. Turn up the allowed memory in your PHP configuration. The upgrade will require more memory than normal operation.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9099
Joined: Wed Aug 10, 2005 12:56 pm

Re: Reaching memory limit during upgrade

Postby nomadit » Wed Mar 26, 2014 2:28 pm

Hi Alec,

Thanks for your reply.

This is a copy of the charset_normalization in my config file:

; Database storage character set
; Must be set to "Off" if not supported by the database server
database_charset = Off

; Enable character normalization to utf-8 (recommended)
; If disabled, strings will be passed through in their native encoding
; Note that client_charset and database collation must be set
; to "utf-8" for this to work, as characters are stored in utf-8
charset_normalization = Off

I can't attach the file. I also had problems applying the patch to HookRegistry.inc.php
but I downloaded it from here http://pkp.sfu.ca/ojs/doxygen/current/h ... ource.html and copied it over the original version in the lib/pkp folder.
nomadit
 
Posts: 6
Joined: Tue Mar 25, 2014 5:17 pm

Re: Reaching memory limit during upgrade

Postby nomadit » Wed Mar 26, 2014 2:39 pm

Another thing: I increased the memory using the php.ini directive but I am still getting the same error message about memory limit. My host did restart the server and checked that memory was increased successfully to 128MB which is far as is recommended by my webhost (Dreamhost).
nomadit
 
Posts: 6
Joined: Tue Mar 25, 2014 5:17 pm

Re: Reaching memory limit during upgrade

Postby asmecher » Wed Mar 26, 2014 2:47 pm

Hi nomadit,

With the memory limit increased to 128MB, did the error message reflect the increased amount? In the message quoted above, the limit appears to be set around 90MB.

The HookRegistry file you linked is equivalent to the version distributed in OJS 2.4.3, so replacing one with the other shouldn't change anything. It shouldn't be necessary to apply any patches to HookRegistry for OJS 2.4.3; there was a memory-saving patch but that only applies to earlier versions.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9099
Joined: Wed Aug 10, 2005 12:56 pm

Re: Reaching memory limit during upgrade

Postby nomadit » Wed Mar 26, 2014 2:58 pm

Thanks again, Alec.

No the error message did not reflect the increase in memory, which made me wonder. But Dreamhost is stating in an email to me that
"It's currently set to 128MB. I wouldn't recommend going any higher than that".
Do you know how I can reliable check the memory limit for my user?
nomadit
 
Posts: 6
Joined: Tue Mar 25, 2014 5:17 pm

Re: Reaching memory limit during upgrade

Postby asmecher » Wed Mar 26, 2014 3:18 pm

Hi nomadit,

I suspect the increase never took effect, e.g. Dreamhost didn't restart the web server to cause the configuration file to be re-read. You should be able to check the memory_limit PHP setting by looking at the phpinfo() output, either by running a test script or by looking in the Site Administrator's interface.

In any case, you should definitely see the changed value reflected in the error message.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9099
Joined: Wed Aug 10, 2005 12:56 pm

Re: Reaching memory limit during upgrade

Postby nomadit » Wed Mar 26, 2014 3:39 pm

Hi Alec,

The increase in memory did take effect, as the phpinfo shows
http://teachinganthropology.org/phpinfo2.php

The script still gives the same error:
Fatal error: Allowed memory size of 94371840 bytes exhausted (tried to allocate 40961 bytes) in /home/teach_anth/teachinganthropology.org/lib/pkp/lib/phputf8/utils/ascii.php on line 94
nomadit
 
Posts: 6
Joined: Tue Mar 25, 2014 5:17 pm

Next

Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 5 guests