When installing the module on a site with content there is a big chance to get a memory exhaustion error

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 40960 bytes)

The issue for this is a very unefficent way of getting all entity ids, as it loads all entities and not just fetches the ids.

The install hook needs to be rewritten to use entity queries to only get the needed ids. Then on install it will not load 5000 entities at once.

CommentFileSizeAuthor
#2 2978882-2.patch1.61 KBkfritsche

Comments

kfritsche created an issue. See original summary.

kfritsche’s picture

Assigned: kfritsche » Unassigned
Status: Active » Needs review
StatusFileSize
new1.61 KB

Here a patch which rewrites the hook_install to use entity queries.

el1_1el’s picture

I cannot install this module in the UI without this patch on a site with 12K+ nodes. Using drush en does work without it, but this is needed for non drush enabling and seems to work as expected.

See also project/content_sync/issues/2985606 for other memory issues.

blanca.esqueda’s picture

blanca.esqueda’s picture

blanca.esqueda’s picture

  • Blanca.Esqueda committed f454d49 on 8.x-2.x
    Issue #2978882 by kfritsche, klimp, luis_mejia, david4lim, dabito,...
blanca.esqueda’s picture

Status: Needs review » Fixed

A commit has been added to 8.x-2.x-dev, the installation process has been updated.
Added credit to the participant in other threads closed as duplicates related to install and export content.

Thank you!!
Blanca

blanca.esqueda’s picture

Status: Fixed » Closed (fixed)
no74h’s picture

I used dev version and I'm still facing the same error. Apparently, the code had been refactored and this patch is not valid anymore. Any infos? Thanks