Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How many categories does magento support? 
 
tfittsy
Jr. Member
 
Total Posts:  12
Joined:  2007-12-16
 

I get this error when I try to manage categories:  Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 35 bytes) in /home/user/public_html/lib/Varien/Data/Tree/Dbp.php on line 179

I used sql inserts to insert these categories so that they would match the categories from my current store and also because inserting 750 categories by hand is a pretty big obstacle in moving over to magento.  My inserts for each category is as below.  The category page loads fine if I limit the inserts to 150 categories.  Much higher and it’s the same error every time.

insert into catalog_category_entity (entity_id, entity_type_id, attribute_set_id, parent_id, created_at, updated_at, is_active, path, position) values (4,3,3,1,now(),now(),1,’1/4’,4);
insert into catalog_category_entity_int (entity_type_id, attribute_id, store_id, entity_id, value) values (3,31,0,4,5);
insert into catalog_category_entity_int (entity_type_id, attribute_id, store_id, entity_id, value) values (3,32,0,4,5);
insert into catalog_category_entity_int (entity_type_id, attribute_id, store_id, entity_id, value) values (3,40,0,4,5);
insert into catalog_category_entity_text (entity_type_id, attribute_id, store_id, entity_id, value) values (3,25,0,4,’Sports’);
insert into catalog_category_entity_text (entity_type_id, attribute_id, store_id, entity_id, value) values (3,28,0,4,’Sports’);
insert into catalog_category_entity_text (entity_type_id, attribute_id, store_id, entity_id, value) values (3,29,0,4,’Sports’);
insert into catalog_category_entity_text (entity_type_id, attribute_id, store_id, entity_id, value) values (3,44,0,4,’’);
insert into catalog_category_entity_varchar (entity_type_id, attribute_id, store_id, entity_id, value) values (3,22,0,4,’Sports’);
insert into catalog_category_entity_varchar (entity_type_id, attribute_id, store_id, entity_id, value) values (3,24,0,4,’sports’);
insert into catalog_category_entity_varchar (entity_type_id, attribute_id, store_id, entity_id, value) values (3,27,0,4,’Sports’);
insert into catalog_category_entity_varchar (entity_type_id, attribute_id, store_id, entity_id, value) values (3,30,0,4,’PRODUCTS’);
insert into catalog_category_entity_varchar (entity_type_id, attribute_id, store_id, entity_id, value) values (3,39,0,4,’’);
insert into catalog_category_entity_varchar (entity_type_id, attribute_id, store_id, entity_id, value) values (3,43,0,4,’’);

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yoke Lee
Sr. Member
 
Avatar
Total Posts:  80
Joined:  2008-05-08
China - Singapore
 

maybe you should insert it from phpmyadmin or such mysql admin panel,
not from inside magento.

however to import one sql file maximum is 16MB.
so you might have to copy paste execute those queries into SQL query box , manually, part by part.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

I’ve heard this is related to php limits set by servers.

 
Magento Community Magento Community
Magento Community
Magento Community
 
gabrielk
Sr. Member
 
Avatar
Total Posts:  83
Joined:  2007-11-30
 

"Fatal error: Allowed memory size of _____ bytes exhausted” means you need more RAM allocated to PHP on your server.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tfittsy
Jr. Member
 
Total Posts:  12
Joined:  2007-12-16
 
Yoke Lee - 19 May 2008 10:13 PM

maybe you should insert it from phpmyadmin or such mysql admin panel,
not from inside magento.

however to import one sql file maximum is 16MB.
so you might have to copy paste execute those queries into SQL query box , manually, part by part.

I did execute the statement from phpmyadmin.  It executed without problems.  The problem is when I try to load the category manager in the admin.

sherrie - 20 May 2008 04:54 AM

I’ve heard this is related to php limits set by servers.

This is correct.

gabrielk - 20 May 2008 05:37 AM

“Fatal error: Allowed memory size of _____ bytes exhausted” means you need more RAM allocated to PHP on your server.

I have a dedicated server and can allocate more ram if necessary.  The point I’m trying to get across is it doesn’t seem like there should be a good reason for 200 categories to exhaust 64MB ram.  That’s saying that each category is using roughly 300k of memory to process.  Do I need to raise my PHP memory limit to 384MB to use 700 categories?  Both of those numbers seem a bit extreme.  I have another 400-700 categories I would like to add in the future, What then? 768MB or a 1GB?  This is for one page load.  That should be enough memory for the whole web server.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yoke Lee
Sr. Member
 
Avatar
Total Posts:  80
Joined:  2008-05-08
China - Singapore
 

sherrie - 20 May 2008 05:54 AM

I’ve heard this is related to php limits set by servers.

I’m sorry I don’t get it. Which server do you mean ? like dedicated server or such ? or something like XAMPP?

Then, have you found out where to set your server for this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
CreedFeed
Member
 
Total Posts:  74
Joined:  2007-08-31
Milwaukee, WI
 

You can change the memory usage within a PHP script by using the following line:

ini_set("memory_limit","32M");

Just set whatever number you want in front of the M… 32M means 32 megabytes.

To change it server wide you’ll need to edit your php.ini file by adding or editing the line

memory_limit 32M

This doesn’t explain why Magento would require more memory to show a large number of categories as the original poster was asking about though.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tfittsy
Jr. Member
 
Total Posts:  12
Joined:  2007-12-16
 
Yoke Lee - 20 May 2008 03:59 PM

sherrie - 20 May 2008 05:54 AM

I’ve heard this is related to php limits set by servers.

I’m sorry I don’t get it. Which server do you mean ? like dedicated server or such ? or something like XAMPP?

Then, have you found out where to set your server for this?

Yes, a dedicated server, not XAMPP or a VM.  Serving web pages is all this computer does.

CreedFeed - 21 May 2008 03:11 AM

You can change the memory usage within a PHP script by using the following line:

ini_set("memory_limit","32M");

Just set whatever number you want in front of the M… 32M means 32 megabytes.

To change it server wide you’ll need to edit your php.ini file by adding or editing the line

memory_limit 32M

This doesn’t explain why Magento would require more memory to show a large number of categories as the original poster was asking about though.

I know how to change the memory limit system-wide or within a script.  The bold part is what I’m really after.  I’ve been programming for over half my life and I know better than to fix a problem like this by throwing more memory at it.  I can’t think of any good reason that 200 categories should exhaust the memory.  I’d like someone to help me fix the cause instead of the effect.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tfittsy
Jr. Member
 
Total Posts:  12
Joined:  2007-12-16
 

Anyone else have any insight into why I would be running out of memory?  Is the way I’m doing sql inserts not functionally equivalent to doing them by hand?  If I added 750 categories by hand is it likely I would still run into this issue?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yoke Lee
Sr. Member
 
Avatar
Total Posts:  80
Joined:  2008-05-08
China - Singapore
 

Maybe u should ask directly to team member.
Maybe Moshe can help?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ChrisP
Jr. Member
 
Total Posts:  6
Joined:  2008-04-30
Florida
 

This is a known bug that I also hope will be fixed soon, here is the bug:

http://www.magentocommerce.com/bug-tracking/issue?issue=1777

Depending on the number of categories you have and the amount of ram for a few people you can increase memory php has and the category page will load in the admin. If your like me and have a lot of category’s then you will not be able to load the page until the bug is fixed.  I think we have a 1000 or so categories.  I was watching “top” on our web server and when I tried to go to the category page in the admin panel apache would continue to consume memory till it was all gone and display the error you mention or a blank page.  I tried this with 256MB alloted to php and still isn’t working.  Like others said for now we have to edit via phpmyadmin. 

The bug is listed as urgent and has been assigned so I’m hoping that means it will be resolved soon. 

I think some of us are just using way more categories then magento had in mind when this feature was built.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ilib
Member
 
Total Posts:  49
Joined:  2008-11-25
Москва
 

with about 500 categories the management page “normally” opens in about 7 minutes
We modified my.cnf as advised HERE and now it opens in less than 4 minutes.
Allocating more memory to PHP did not help.
As I see now Mysql does not concumes CPU anymore (previously it took up to 60%)

There is only one solution: To optimise PHP code

 
Magento Community Magento Community
Magento Community
Magento Community
 
magedev
Sr. Member
 
Avatar
Total Posts:  117
Joined:  2009-06-01
 

I guess there’s been updates in Magento category handling. Having almost 600 categories my admin pages loads instantly even on my local machine under wamp. However when importing categories I encounter serious performance problems when trying to move categories inside category tree (using

Mage_Catalog_Model_Category_Api::move()
method. Instead I sorted my entry categories and was able to set $parentId attribute when creating category by the use of
Mage_Catalog_Model_Category_Api::create()
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top