HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


[Solved] memory_limit limited to 64M

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#75744 (In Topic #15665)
Avatar

Well-settled

Here is a weird problem. My site has been having a problem which probably appeared after a couple of updates (currently running on 7.1.4, will update to latest soon). The server has been filling up with huge core.* files and error_log is full of this:

PHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 122880 bytes) in /home/metaltem/public_html/sources/tempcode.php(1601) : eval()'d code on line 14

I'm running on Hostgator's VPS and have whm and ssh access. PHP is set to use 128M and running a manual phpinfo page from the root of the site reports that it is indeed using 128M.

Running PHP info from OC Portal's admin though reports that Global memory_limit is 128M but local is 64M. I even used the php settings portion from recommended.htaccess but it didn't work.

There is a chance that I had "Force memory conservation" enabled before the updates, but even though it shows up when I use admin's search function the option is hidden in the actuall settings page.

Can anyone point me to the right direction? :)


Last edit: by Palanthas
Back to the top
 
Posted
Rating:
#75746
Avatar

Well-settled

Updated to 7.1.5 and changed has_low_memory_limit field in the database's config table from 1 to 0 but I still get 64M reported… no php.ini that I can trace inside my installation as well, unless it's very well hidden. :S
Back to the top
 
Posted
Rating:
#75747
Avatar

ocPortal itself is probably lowering the limit. Do you know what particular pages are running out of memory?


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#75748
Avatar

Well-settled

Hey Chris! :)

[06-Oct-2011 10:17:37] PHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 89428 bytes) in /home/metaltem/public_html/sources/tempcode.php(1298) : eval()'d code on line 1

[06-Oct-2011 10:26:50] PHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 122880 bytes) in /home/metaltem/public_html/sources/tempcode.php(1601) : eval()'d code on line 14

I get these mostly. I'm guessing the front page has the most hits but is there any way I can track down which one in particular. Also the error log is filling up with these, dunno if they are related:

[06-Oct-2011 11:02:11] PHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in /home/metaltem/public_html/sources/tempcode.php(1298) : eval()'d code on line 1
[06-Oct-2011 11:02:39] PHP Notice:  Undefined variable: sort_asc_selected in sources/catalogues.php on line 409
[06-Oct-2011 11:02:39] ocPortal:  PHP NOTICE [8] Undefined variable: sort_asc_selected in sources/catalogues.php on line 409 (version: 7.1.5, PHP version: 5.3.8, URL: /site/catalogues/category/greek_live_shows.htm?order=59+ASC&
start=247&max=50)
[06-Oct-2011 11:03:33] PHP Notice:  Undefined variable: sort_asc_selected in sources/catalogues.php on line 409
[06-Oct-2011 11:03:33] ocPortal:  PHP NOTICE [8] Undefined variable: sort_asc_selected in sources/catalogues.php on line 409 (version: 7.1.5, PHP version: 5.3.8, URL: /site/catalogues/category/greek_live_shows.htm?order=62+DESC
&start=282&max=294)
Back to the top
 
Posted
Rating:
#75754
Avatar

Well-settled

I also get this in adminzone's phpinfo

max_execution_time   local:60   master:30

so it seems like my ocportal installtion is setting its own rules.  :lol: As a reminder this is an original installation from OCP4 with all the upgrades up till the latest.

Maybe I can force it somehow to use 128M?
Back to the top
 
Posted
Rating:
#75764
Avatar

Does anything show up in the Apache logs?

To stop ocPortal changing the limit remove this line from sources/global2.php:

   @ini_set('memory_limit','64M');


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#75771
Avatar

Well-settled

Commenting out that line did the trick though I guess I have to track down the real reason why I get this error. Right now error_log only has this popping up:

PHP Notice:  Undefined variable: sort_asc_selected in sources/catalogues.php on line 409

Line 409 is:

$head->attach(do_template('CATALOGUE_'.$tpl_set.'_TAB_FIELD_
HEAD',array('SORT_ASC_SELECTED'=>$sort_asc_selected,'SORT_DES
C_SELECTED'=>$sort_desc_selected,'SORT_URL_ASC'=>$sort_url_as
c,'SORT_URL_DESC'=>$sort_url_desc,'CATALOGUE'=>$catalogue_nam
e,'FIELDID'=>strval($i),'_FIELDID'=>strval($field['id']),'FIE
LD'=>get_translated_text($field['cf_name']),'FIELDTYPE'=>$fie
ld['cf_type']),NULL,false,'CATALOGUE_DEFAULT_TAB_FIELD_HEAD')
);

this error is always followed by

[06-Oct-2011 22:07:18] ocPortal:  PHP NOTICE [8] Undefined variable: sort_asc_selected in sources/catalogues.php on line 409 (version: 7.1.5, PHP version: 5.3.8, URL: /site/catalogues/category/worldwide_live_shows.htm?order=62+
DESC&start=160&max=100)

The page shows the complete error at http://www.metal-temple.com/site/catalogues/category/worldwide_live_shows.htm

I get that in every catalogue falling under this category: Index: Reports - Metal-Temple.com
Back to the top
 
Posted
Rating:
#75793
Avatar

Fix to catalogues issue.

Attachment
sources/catalogues.php
» Download: catalogues.php (52 Kb, 132 downloads so far)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#75795
Avatar

Regarding memory, ocPortal sets a 64MB maximum limit in case there are ever any run-away-memory-usage bugs – which potentially can take a server down. There haven't been in quite a while, but it's a precaution.

32 should really be enough, so whatever is using more than 64MB is probably a bug.

Now you have the limit temporarily removed, you can browser around with &keep_memory_limit_test=32 in the URL (you must be admin) and see what pages don't run. Then let us know.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#75832
Avatar

Well-settled

catalogues.php patch worked, problem fixed. Snooping around with that option to see what page gives me probs. Will report back, I'm thinking my site is an excellent testbed on how the site works with a few thousands of catalogue entries.  :lol:
Back to the top
 
Posted
Rating:
#104805

Non-joined user

on a vps server i change mem limils in global 2 to 256 meg
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: