Fatal error: Required memory size is 64MB

10 years 3 months ago #97173 by sriz786
Hi read the notes below

when i want to insert any plan in CB SUBS backend that prompt me the error

Fatal error: Allowed memory size of 50331648 bytes exhausted (tried to allocate 610739 bytes) in www/libraries/joomla/document/html/html.php on line 389

RESPONSE:

PHP has built-in safeguard to prevent runaway scripts from taking down the whole system. One aspect of this is to limit memory that can be allocated for each running script. For AbleCommunity, we've setup the memory limit to 48MB. IMHO, this limit is already very huge. If our script is hitting this limit, such as the case below, there are 2 ways to fix this:

1. Bump maximum allowed memory from 48M to something bigger ... like 64M or greater.
2. Optimize the script so that the script doesn't need more than 48M.

Personally, I feel reluctant on bumping up 48M memory limit to a script. Remember when the whole computer had only 64MB memory? That's for the whole computer (including OS). If our script is hitting 48MB just to process some pages, then there has to be some optimization (IMHO) that we can do so that the memory requirement for a script can be within 48MB. Doing this will also mean that the script takes less resources and as such, more scalable for higher traffic.

Theree are cases, however, that when it's absolutely necessary for a sript to hit 48MB memory. In that case, there's no other option than to bump the maximum allowed memory.

I NEED GUIDANCE FROM NICK If we can improve the script to require less memory for PHP SCRIPT.

THANK YOU,
RIZWAN
10 years 3 months ago #97181 by nant
sriz786 wrote:

Hi read the notes below

when i want to insert any plan in CB SUBS backend that prompt me the error

Fatal error: Allowed memory size of 50331648 bytes exhausted (tried to allocate 610739 bytes) in www/libraries/joomla/document/html/html.php on line 389

RESPONSE:

PHP has built-in safeguard to prevent runaway scripts from taking down the whole system. One aspect of this is to limit memory that can be allocated for each running script. For AbleCommunity, we've setup the memory limit to 48MB. IMHO, this limit is already very huge. If our script is hitting this limit, such as the case below, there are 2 ways to fix this:

1. Bump maximum allowed memory from 48M to something bigger ... like 64M or greater.
2. Optimize the script so that the script doesn't need more than 48M.

Personally, I feel reluctant on bumping up 48M memory limit to a script. Remember when the whole computer had only 64MB memory? That's for the whole computer (including OS). If our script is hitting 48MB just to process some pages, then there has to be some optimization (IMHO) that we can do so that the memory requirement for a script can be within 48MB. Doing this will also mean that the script takes less resources and as such, more scalable for higher traffic.

Theree are cases, however, that when it's absolutely necessary for a sript to hit 48MB memory. In that case, there's no other option than to bump the maximum allowed memory.

I NEED GUIDANCE FROM NICK If we can improve the script to require less memory for PHP SCRIPT.

THANK YOU,
RIZWAN


Agree with 48M should be enough.

What other components/scripts have you installed in same environment/site? Could be something else taking up resources.
10 years 3 months ago #97182 by beat
My first computer had 1 *kilo*byte RAM back in the 70's, so I'm fully with you. :)
When I see in PHP that a simple string can take *kilo*bytes of RAM, sometimes dozens...you can imagine what I think from where I come :D ...However as PHP is the most widespread language on webserver, we'll have to live with it.

Anyway, back to topic:


All Joomla 1.5 system plugins and all CB plugins in particular are loaded in backend for integration purposes.

- Maybe you have another memory-hungry CB plugin or Joomla 1.5 plugin ?

Two other possibilities to check:

- What's your PHP version ?

Rquired PHP is PHP 5, but recommended PHP is 5.2.3 minimum.

- Does your PHP run with the obsolete "ze1_compatibility_mode" on ?

PHP versions < 5.1.3 and ze1_compatibility_mode ON do require quite some extra memory in backend, as we had to re-implement in PHP a buggy PHP 5 library, which got fixed only in 5.1.3, so it can be

With PHP 5.2.9 and of course ze1_compatibility_mode OFF, and the full set of CB Team plugins loaded, I'm runing full backend in quite less than 48 Megs here.

One other thing which might improve your memory requirements and execution speed dramatically: a php code cache...

Hope that gives some hunting directions.

To reply to the other remarks:

Front-end memory has been optimized. That's not an issue where most usages are.

Higher memory usage is only in backend, as backend UI is huge in possibilities, and that's less of an issue in regards to your remark on multiplying factors, so as quick fix you could increase memory for backend (ask your hoster), or hunt down the issue on the tracks given above...

Please post back your findings :)

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info
10 years 3 months ago #97411 by beat
Could you find the origin of your issue ?

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info
Moderators: beatnantkrileon
Time to create page: 0.386 seconds
Facebook Twitter Google LinkedIn