Project

Profile

Help

Issue #9262

closed

Django Lifecycle doubles memory usage of all "Content" objects due to change-tracking

Added by dalley over 3 years ago. Updated almost 3 years ago.

Status:
CLOSED - NOTABUG
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Django Lifecycle has hook system that activates when fields on models are changed - in order to implement this, it keeps a copy of the initial state of all fields, so that it can tell when they change.

We do not benefit from this since content (at least, all content to date) are immutable, but we suffer significantly from it as it doubles the in-memory size of all content objects. When these objects are very large, as frequently occurs with the RPM plugin, this can be significant.

We should find a way to opt out of this functionality, or create one ourselves with an upstream contribution.

https://github.com/rsinger86/django-lifecycle/blob/9c0d1289568ea070d0e0a396980a29d6f9b7b959/django_lifecycle/mixins.py#L26


Files

Actions #1

Updated by fao89 about 3 years ago

  • Triaged changed from No to Yes
Actions #2

Updated by dalley almost 3 years ago

  • Status changed from NEW to CLOSED - NOTABUG

Everything above is true except that it seems like the copies are mere shallow copies (the reference count was incremented rather than duplicating the object). Therefore fixing this issue doesn't result in significant memory savings.

Also available in: Atom PDF