Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue14596] struct.unpack memory leak

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jun 23, 2012, 5:21 AM

Post #1 of 5 (111 views)
Permalink
[issue14596] struct.unpack memory leak

Serhiy Storchaka <storchaka [at] gmail> added the comment:

Reduction of memory consumption of struct is a new feature. Any chance to commit struct_repeat.patch+struct_sizeof.patch today and to get this feature in Python 3.3?

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14596>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 23, 2012, 5:24 AM

Post #2 of 5 (112 views)
Permalink
[issue14596] struct.unpack memory leak [In reply to]

Mark Dickinson <dickinsm [at] gmail> added the comment:

I'm still not convinced that something like struct_repeat.patch is necessary. So unless someone else wants to own this issue and review the struct_repeat, I'd say that it's too late for 3.3.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14596>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 23, 2012, 5:47 AM

Post #3 of 5 (114 views)
Permalink
[issue14596] struct.unpack memory leak [In reply to]

Serhiy Storchaka <storchaka [at] gmail> added the comment:

Now internal representation of Struct with small format string may
consume unexpectedly large memory and this representation may be
invisible cached. With patch you can get large internal representation
only for large format strings. It is expected.

And how about struct_sizeof.patch? Now sys.getsizeof() returns wrong
result for Struct:

28
>>> sys.getsizeof(struct.Struct('100B'))
28

The patch (it compatible with both Struct representations) fixes it:

52
>>> sys.getsizeof(struct.Struct('100B'))
1240

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14596>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 23, 2012, 6:57 AM

Post #4 of 5 (108 views)
Permalink
[issue14596] struct.unpack memory leak [In reply to]

Mark Dickinson <dickinsm [at] gmail> added the comment:

The struct_sizeof patch looks fine, but lacks tests. I think it might be reasonable to call this a bugfix.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14596>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 23, 2012, 1:41 PM

Post #5 of 5 (108 views)
Permalink
[issue14596] struct.unpack memory leak [In reply to]

Serhiy Storchaka <storchaka [at] gmail> added the comment:

Here is Struct.__sizeof__ patch with tests.

----------
Added file: http://bugs.python.org/file26115/struct_sizeof-2.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14596>
_______________________________________
Attachments: struct_sizeof-2.patch (1.83 KB)

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.