Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling clear / removeAllItems / removeItemByKey on Magento\Eav\Model\Entity\Collection\AbstractCollection does not remove model from protected _itemsById array #484

Closed
wants to merge 1 commit into from

Conversation

rgranadino
Copy link

When paginating through EAV collection models (e.g. customers or products) calling the clear method does not reset the $_itemsById protected member. This causes the list of objects referenced in that array to grow exponentially. When working with large collections (e.g. for exports or reports) this can lead to exhausting the amount of memory that a script is allowed to allocate.

NOTE: This issue exists in mage1 as well.

I also went ahead and updated removeAllItems and removeItemByKey.

I'd be happy to write a test case but there doesn't appear to be a base one at this time. I'd be helpful if you could point me in the right direction (another similar test case) as this functionality relies on loading entities.

On a side note, whats the difference supposed to be between clear and removeAllItems ?

@verklov verklov self-assigned this Feb 14, 2014
@verklov
Copy link
Contributor

verklov commented Feb 14, 2014

@rgranadino , thank you for contributing to Magento 2! We have created a ticket and placed it to the product backlog. We will let you know once the issue is resolved.

@verklov
Copy link
Contributor

verklov commented Apr 23, 2014

@rgranadino, the team processed your contribution and it was deployed to the GitHub in dev65. For some reason it appeared in changelog, but the initial pull request was not referenced. We are closing this pull request.

@verklov verklov closed this Apr 23, 2014
magento-team pushed a commit that referenced this pull request Jul 22, 2015
mmansoor-magento pushed a commit that referenced this pull request Oct 10, 2016
Bugs:
MAGETWO-58976: [Magento Cloud] - Import issue with a multiselect option having special symbols (, and |)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants