[issue32045] Does json.dumps have a memory leak?

2018-01-30 Thread Rohan D'Sa

Rohan D'Sa <roh4n@gmail.com> added the comment:

Yes. Thanks.

On 30 Jan 2018 8:31 PM, "Cheryl Sabella" <rep...@bugs.python.org> wrote:

>
> Cheryl Sabella <chek...@gmail.com> added the comment:
>
> Can this be closed as 'Not a Bug'?
>
> --
> nosy: +csabella
>
> ___
> Python tracker <rep...@bugs.python.org>
> <https://bugs.python.org/issue32045>
> ___
>

--

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32045>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32045] Does json.dumps have a memory leak?

2017-11-16 Thread Rohan D'Sa

Rohan D'Sa <roh4n@gmail.com> added the comment:

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.

--

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32045>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32045] Does json.dumps have a memory leak?

2017-11-16 Thread Rohan D'Sa

New submission from Rohan D'Sa <roh4n@gmail.com>:

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.

--
components: Library (Lib)
messages: 306344
nosy: rohandsa
priority: normal
severity: normal
status: open
title: Does json.dumps have a memory leak?
versions: Python 3.6

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32045>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com