Message243920
The array module is good if you *really* drop references:
$ ./python -X showrefcount
Python 3.5.0a4+ (default, May 23 2015, 16:44:38)
[GCC 4.9.2 20150212 (Red Hat 4.9.2-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, gc
[54618 refs, 15960 blocks]
>>> import array; del array; del sys.modules['array']; gc.collect()
6
[54851 refs, 15973 blocks]
>>> import array; del array; del sys.modules['array']; gc.collect()
6
[54851 refs, 15973 blocks]
>>> import array; del array; del sys.modules['array']; gc.collect()
6
[54851 refs, 15973 blocks]
There is a cycle between a each built-in function and its module. Modules aren't optimized for being unloaded. |
|
Date |
User |
Action |
Args |
2015-05-23 15:20:10 | petr.viktorin | set | recipients:
+ petr.viktorin, ncoghlan, larry, python-dev, eric.snow |
2015-05-23 15:20:10 | petr.viktorin | set | messageid: <1432394410.48.0.666390634825.issue24268@psf.upfronthosting.co.za> |
2015-05-23 15:20:10 | petr.viktorin | link | issue24268 messages |
2015-05-23 15:20:10 | petr.viktorin | create | |
|