Jump to content

PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 21446148 bytes


Recommended Posts

Hi all,

 

I installed prestashop 1.5.3.1 and worked fine for a few weeks.

Suddenly the Fatal error occurred. It is only store front, the admin page is no problem.

 

PHP version: 5.3.3

Memory limit: 256M

Max execution time: 300

MySQL version: 5.1.67

MySQL engine: InnoDB

Prestashop version: 1.5.3.1

 

error log shows

PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 21446148 bytes) in /XXXXXX/modules/blocktopmenu/blocktopmenu.php on line 644

 

Then I increase Memory limit: from 256M to 512M. But I got another error.

 

The errors are

PHP Fatal error: Maximum execution time of 300 seconds exceeded in /XXXXXX/classes/Tools.php on line 982

Maximum execution time of 300 seconds exceeded in /XXXXXX/classes/ObjectModel.php on line 221

PHP Fatal error: Maximum execution time of 300 seconds exceeded in /XXXXXX/classes/Tools.php on line 1044

 

Does anyone know how to avoid these fatal error?

 

Thank you

Link to comment
Share on other sites

Nothing should take 300 seconds just when browsing your site (creating a backup, or running a process that talks to a 3rd party API are an exception, but doesn't sound like it's the case.)

 

How many categories do you have?

Try to disable your category block, and see if the error is gone?

Link to comment
Share on other sites

hi, tomerg3

 

Thank you for your reply.

I disabled all categories, then we can browse the store front top page.

 

We have 170 categories and they have 4 levels.

It seems that the fatal error occurs after entry the new products.

 

Can the prestashop handle the above categories?

 

Do we have to optimize?

 

Do we need more server spec?

 

Current spec

- Intel® Xeon® CPU X3220 @ 2.40GHz, 4 cores

- 4GB memory

- CentOS Linux 6.2

 

In addition, Our products are shoes and there are options, such as color, size and width.

Link to comment
Share on other sites

Hi, tomerg3

 

I disabled categories.

This time I enable the categories and try to disable the module "Top horizontal menu".

After that the fatal error did not occur, this module is the culprit.

I reconfigure this module and works fine now.

 

Thank you

Edited by prestalike (see edit history)
Link to comment
Share on other sites

  • 6 months later...

I got the same issue after I install a new theme which I bought (not important the exact one as it will be a negative advertisement)

 

I copied the whole website locally and enabled profiling in php to see the reason. 

It turned out the new theme had a few modules like topmenu, featured products ... that were very very slow.  I don't have the resources to optimize each module so I am thinking cache-ing the module output.

 

Maybe contacting the theme developer will solve the things faster in our case (in case your theme is not free also)

Link to comment
Share on other sites

Hello

 

Here is the error:

 

[PrestaShop] Fatal error in module blocktopmenu:

Allowed memory size of 536870912 bytes exhausted (tried to allocate 3586110 bytes)

 

I have 1 GB ram  on OVH !

 

I have disable the categorie block !

 

How to solve ?

 

Problem occurs in 1.5.6.1 with blockmenu 1.7 / blockmenu 1.6 !!!

 

HELP !!!!!

Link to comment
Share on other sites

To be more accurate :

 

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 3586064 bytes) in /homez.314/xxxxxxxxxxx/www/modules/blocktopmenu/blocktopmenu.php on line 650
[PrestaShop] Fatal error in module blocktopmenu:
Allowed memory size of 536870912 bytes exhausted (tried to allocate 3586064 bytes)

Link to comment
Share on other sites

I have 50 categories but it is not big....

What can I do ?

 

I have install a new theme to test

Same probleme:

 

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 53407 bytes) in /homez.314/xxxxx/www/modules/leobootstrapmenu/libs/Helper.php on line 25
[PrestaShop] Fatal error in module Helper:
Allowed memory size of 536870912 bytes exhausted (tried to allocate 53407 bytes)

 

On line 25:

 

    public static function treeCategory($id, &$list, $children, $tree=""){        
        if (isset($children[$id])){
            if($id != 0){
                $tree = $tree." - ";
            }
            foreach ($children[$id] as $v) {
                $v["tree"] = $tree;
                $list[] = $v;
                self::treeCategory( $v["id_category"], $list, $children,$tree);
            }
        }
    }

Link to comment
Share on other sites

@botmez Something else seems wrong, your script is eating 512MB wich is not normal

 

Maybe there is an infinite look or something. With all due respect to leo I have an experience with one of his themes which is very very slow. Maybe it's better to contact him for support

Link to comment
Share on other sites

×
×
  • Create New...