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 petr.viktorin
Recipients eric.snow, larry, ncoghlan, petr.viktorin, python-dev
Date 2015-05-23.15:20:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1432394410.48.0.666390634825.issue24268@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-05-23 15:20:10petr.viktorinsetrecipients: + petr.viktorin, ncoghlan, larry, python-dev, eric.snow
2015-05-23 15:20:10petr.viktorinsetmessageid: <1432394410.48.0.666390634825.issue24268@psf.upfronthosting.co.za>
2015-05-23 15:20:10petr.viktorinlinkissue24268 messages
2015-05-23 15:20:10petr.viktorincreate