Closed (fixed)
Project:
Drupal core
Version:
8.7.x-dev
Component:
entity system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Aug 2019 at 16:42 UTC
Updated:
27 Sep 2019 at 18:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
doidd commentedComment #3
cilefen commentedThis could be a duplicate of #3056540: taxonomy_post_update_make_taxonomy_term_revisionable() timeouts with large numbers of terms or one of the issues related to #3052464: Cannot update to 8.7.0 because of taxonomy_post_update_make_taxonomy_term_revisionable.
Comment #4
doidd commented@cilefen
My Stack: docker, nginx, php 7.3, postgresql
Comment #5
doidd commentedI fixed this issue by the patch.
Comment #6
catchComment #7
catchComment #8
amateescu commented@doidd, very nice find!
Manually tested this with ~13K terms by checking memory usage with and without the patch, and the results speak for themselves :)
HEAD: 600.7 MiB
Patch: 81.4 MiB
$entity_identifierscould be a list of ID or revision IDs, so we can't pass it directly toresetCache(). Instead, we should callresetCache()without any argument in order to clear everything.Fixed in the patch attached.
Comment #9
amateescu commentedOops, forgot to attach the patch.
Comment #10
catchI think the patch as it stands will result in clearing the entire persistent entity cache each time, see #2635440: Document what cache clearing from ContentEntityStorageBase::resetCache() actually clears. However it should now be possible to empty entity.memory_cache directly - see https://www.drupal.org/node/2973262
Another issue that would help with this is #1199866: Add an in-memory LRU cache.
Comment #11
amateescu commented@catch, I was thinking that a generic
resetCache()call would also take care of the revision cache (when we'll have it), but that will probably use the sameentity.memory_cacheservice so we should be fine with a more targeted approach. I tested this new patch in the same scenario as #8 and got the same results, the memory leak is fixed.Comment #14
catchCommitted/pushed to 8.8.x, and cherry-picked to 8.7.x, thanks!
Comment #15
catchdouble post
Comment #16
catchI just realised that #3055443: Switch to a null backend for all caches for running the database updates (which I just committed), renders this issue a bit moot. However I think we should probably leave it as is, since the code could potentially be used outside an update (like a drush command or similar), and because I didn't backport the other patch to 8.7
Comment #17
catchDidn't mean to change the status, leaving fixed.