A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-March/034221.html below:

[Python-Dev] funny leak

[Python-Dev] funny leakTim Peters tim.one@comcast.net
Mon, 24 Mar 2003 11:10:46 -0500
OK, there's no leaking memory here, but there is a leaking refcount:  the
refcount on the int 0 keeps going up.  The compiler has leaked references to
little integers before, but offhand I don't recall the details.

----- old stuff -----
OK, *this* program leaks a reference each time around; probably a missing
decref in the compiler:

source = """\
def conjoin(gs):
    def gen():
        gs      # unbreakable cycle
        gen     # unless one is commented out
"""

def one():
    exec source in {}

import sys, gc
lastrc = 0
while 1:
    one()
    gc.collect()
    thisrc = sys.gettotalrefcount()
    print thisrc - lastrc,
    lastrc = thisrc




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4