Message306344
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. |
|
| Date |
User |
Action |
Args |
| 2017-11-16 08:20:19 | rohandsa | set | recipients:
+ rohandsa |
| 2017-11-16 08:20:19 | rohandsa | set | messageid: <1510820419.37.0.213398074469.issue32045@psf.upfronthosting.co.za> |
| 2017-11-16 08:20:19 | rohandsa | link | issue32045 messages |
| 2017-11-16 08:20:19 | rohandsa | create | |
|