This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients pitrou, rohandsa, serhiy.storchaka
Date 2017-11-16.09:01:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510822892.3.0.213398074469.issue32045@psf.upfronthosting.co.za>
In-reply-to
Content
indent=True just makes json to use Python implementation instead of C implementation. Python implementation uses closures which reference one other. Simple example not involving json is:

import gc

def f():
    def g():
        return h
    def h():
        return g
    return

gc.set_debug(gc.DEBUG_LEAK)
while True:
    f()
    gc.collect()
    print(f"garbage count: {len(gc.garbage)}")


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.
History
Date User Action Args
2017-11-16 09:01:32serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, rohandsa
2017-11-16 09:01:32serhiy.storchakasetmessageid: <1510822892.3.0.213398074469.issue32045@psf.upfronthosting.co.za>
2017-11-16 09:01:32serhiy.storchakalinkissue32045 messages
2017-11-16 09:01:31serhiy.storchakacreate