#36701: ModelState objects create reference cycles that require a gc pass to
free
-------------------------------------+-------------------------------------
Reporter: Patryk Zawadzki | Owner: Varun
Type: | Kasyap Pentamaraju
Cleanup/optimization | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: memory gc | Triage Stage: Accepted
modelstate fields_cache |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Varun Kasyap Pentamaraju):
Hi,
I tried adding the `__del__` method to `ModelState` as suggested.
I also wrote a `gc` test to check for the `OneToOneField` reference cycle.
The test is still **failing**, and the objects are not being collected.
I am worried that adding `__del__` to an object inside a reference cycle
might be preventing the garbage collector from cleaning it up. This
`__del__` approach might not be the right fix here.
--
Ticket URL: <https://code.djangoproject.com/ticket/36701#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019a3fbdb689-4f28d83d-a4e2-457a-bbb0-9d4ee5ba7256-000000%40eu-central-1.amazonses.com.