Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: chr() leaks #4422

Open
Open
@pmp-p

Description

@pmp-p
#
# to run with small heap eg -X heapsize=16384
#

try:
    import utime as time
except:
    import time

import gc
cnt = 1
last = 0

while cnt < 0x110000:
    time.sleep(.005)
    current = gc.mem_free()
    #GOOD print( '[%c]' % cnt , current - last, current )

    #BAD print( '{}'.format( chr(cnt) ), current - last, current )

    #BAD
    print( chr( cnt ), cnt , current - last, current )
    cnt +=1
    last = current
    gc.collect() #no effect maybe a useless volatile interned strings of length 1 somewhere ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpy-coreRelates to py/ directory in source

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions