You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2018-01-30.23:00:31.954>created_at=<Date2017-11-16.08:20:19.359>labels= ['invalid', 'library']
title='Does json.dumps have a memory leak?'updated_at=<Date2018-01-30.23:00:31.953>user='https://bugs.python.org/rohandsa'
The "leak" is caused by using gc.set_debug(gc.DEBUG_LEAK). gc.DEBUG_LEAK includes gc.DEBUG_COLLECTABLE, gc.DEBUG_UNCOLLECTABLE and gc.DEBUG_SAVEALL. gc.DEBUG_SAVEALL causes garbage-collected objects to be saved in gc.garbage for inspection. In normal circumstances they are collected.
rohandsa commented on Nov 17, 2017
rohandsamannequin
MannequinAuthor
More actions
you are right. i realized later i actually had a leak in a com instantiated object, assumed it was a leak in the python and tried to find it using the gc module.
The gc documentation led me down the garden path.
QUOTE
gc.garbage
A list of objects which the collector found to be unreachable but could not be freed (uncollectable objects).
UNQUOTE
i assumed:
cyclic references are unreachable but can be freed and hence collectable.
__del__ finalizer (with cyclic references?) objects are unreachable and cannot be freed and hence uncollectable.
Activity
rohandsa commentedon Nov 16, 2017
Using the following code under Python 3.6.3, the garbage count keeps increasing and windows task manager records steady memory increase.
However without indent json.dumps(self.__dict__), no leak is observed.
serhiy-storchaka commentedon Nov 16, 2017
The "leak" is caused by using gc.set_debug(gc.DEBUG_LEAK). gc.DEBUG_LEAK includes gc.DEBUG_COLLECTABLE, gc.DEBUG_UNCOLLECTABLE and gc.DEBUG_SAVEALL. gc.DEBUG_SAVEALL causes garbage-collected objects to be saved in gc.garbage for inspection. In normal circumstances they are collected.
rohandsa commentedon Nov 17, 2017
you are right. i realized later i actually had a leak in a com instantiated object, assumed it was a leak in the python and tried to find it using the gc module.
The gc documentation led me down the garden path.
QUOTE
gc.garbage
A list of objects which the collector found to be unreachable but could not be freed (uncollectable objects).
UNQUOTE
i assumed:
csabella commentedon Jan 30, 2018
Can this be closed as 'Not a Bug'?
rohandsa commentedon Jan 30, 2018
Yes. Thanks.
On 30 Jan 2018 8:31 PM, "Cheryl Sabella" <report@bugs.python.org> wrote: