[ python-Bugs-980419 ] int left-shift causes memory leak
SourceForge.net
noreply at sourceforge.net
Sat Jun 26 16:36:39 EDT 2004
Bugs item #980419, was opened at 2004-06-26 16:36
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=980419&group_id=5470
Category: Python Interpreter Core
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Erik Demaine (edemaine)
Assigned to: Nobody/Anonymous (nobody)
Summary: int left-shift causes memory leak
Initial Comment:
The following Python one-liner causes the Python image
size to grow quickly (beyond 100 megabytes within 10
seconds or so on my Linux 2.4.18 box on an Intel
Pentium 4):
while True: 1 << 64
The point is that 1 << 64 gets automatically turned
into a long. Somehow, even after all pointers to this
long disappear, it (or something produced along the
way) sticks around. The same effect is obtained by the
following more natural code:
while True: x = 1 << 64
There is an easy workaround; the following code does
not cause a memory leak:
while True: 1L << 64
However, a memory leak should not be intended behavior
for the new int/long unification.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=980419&group_id=5470
More information about the Python-bugs-list
mailing list