Vinai / groupscatalog2

Magento extension to enable you to hide categories and products from customers depending on their customer group. This is a Magento 1.6 and newer compatible version of the Netzarbeiter Customer Groups Catalog extension.
139 stars 60 forks source link

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes) in /home/(username)/public_html/app/code/community/Netzarbeiter/GroupsCatalog2/Model/Resource/Indexer/Abstract.php on line 357 #27

Closed alaldin closed 11 years ago

alaldin commented 11 years ago

Hi

I am getting the below Fatal error when I re-index groupscatalog2_product manually, any idea why and what I can do to fix it.

When I re-index groupscatalog2_category it indexes successfully, HELP :(

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes) in /home/comamari/public_html/app/code/community/Netzarbeiter/GroupsCatalog2/Model/Resource/Indexer/Abstract.php on line 357

Do I need to increase php memory?

Many thanks

Amer Laldin (M.D)

Vinai commented 11 years ago

256MB should be enough. How many Products, Customer Groups and Store Views do you have?

alaldin commented 11 years ago

We only have one store view with 152077 products & 4 customer groups.

I changed the php memory to 1gb on the server but we still get the same error ☺.

Vinai commented 11 years ago

Please try the following and post the results:

This should significantly reduce the memory footprint enabling you to run the indexer, even though it will mean a slower index process for smaller catalog instances. If this does indeed resolve the issue for you I'll make it a configurable value.

Vinai commented 11 years ago

Can you provide feedback if changing the chunk size resolves the issue?

alaldin commented 11 years ago

I haven’t had the chance to make the changes to provide the feedback, I am back in the office today and hopefully I will be able to send some back to you today.

alaldin commented 11 years ago

Hi Vinai

Sorry I could not get back to you sooner, we had development being carried out and did not want to do anything till it was done.

I did what you said and it did not work but I got the below error.

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes) in /home/comamari/public_html/app/code/community/Netzarbeiter/GroupsCatalog2/Model/Resource/Indexer/Abstract.php on line 357

Sorry I could not get back to you sooner, we had development being carried out and did not want to do anything till it was done.

Please advise....

Vinai commented 11 years ago

I am currently refactoring the indexing process. Can't give you an ETA at the moment, but I hope to work on it for a few hours over the weekend.

alaldin commented 11 years ago

Brilliant thanks Vinai, it would be good to get this working...

alaldin commented 11 years ago

Hi Vinai

Any luck with the below?

Vinai commented 11 years ago

Sorry, still a work in progress. This week I'll won't manage to put in any time though, too much right now.

alaldin commented 11 years ago

Ok when done please let me know what to do and I will install the ext again.

alaldin commented 11 years ago

Hi Vinai

Any luck with the above?

Vinai commented 11 years ago

Hi,

I've pushed a new version of app/code/community/Netzarbeiter/GroupsCatalog2/Model/Resource/Indexer/Abstract.php to the master branch. In effect, the class now iterates over a query cursor instead of a full result set.

Please see https://github.com/Vinai/groupscatalog2/commit/017d395151a017e889dbaed987b19c28f2bda417 for details, if you only want to apply the changes to the single class. If possible, can you please check if this makes any difference for you?

If you need more information to apply the change in your codebase, please let me know. Thanks!

Vinai commented 11 years ago

No further feedback from original poster, assuming fixed and closing this issue.