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 rohandsa
Recipients rohandsa
Date 2017-11-16.08:20:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510820419.37.0.213398074469.issue32045@psf.upfronthosting.co.za>
In-reply-to
Content
import gc, json

class leak(object):
    def __init__(self):
        pass

gc.set_debug(gc.DEBUG_LEAK)
while True:
    leak_ = leak()
    json.dumps(leak_.__dict__, indent=True)
    gc.collect()
    print(f"garbage count: {len(gc.garbage)}")

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.
History
Date User Action Args
2017-11-16 08:20:19rohandsasetrecipients: + rohandsa
2017-11-16 08:20:19rohandsasetmessageid: <1510820419.37.0.213398074469.issue32045@psf.upfronthosting.co.za>
2017-11-16 08:20:19rohandsalinkissue32045 messages
2017-11-16 08:20:19rohandsacreate