Skip to content

try to unreference objects sooner in generated code #8393

@DumpsterDoofus

Description

@DumpsterDoofus

I originally posted this on StackOverflow, but calling gc() inside of a function does not always appear to work properly. Iain was able to reproduce the issue, and suggested I post it here.

I originally encountered this issue (bug?) when I was running code that I had been pasting into the REPL from a text editor, and decided to instead put the code inside a function in order to make it more convenient to execute. I was surprised to find that the exact same code which executed in the global scope without any problems would swallow up all the available RAM on my computer and give a MemoryError when it was wrapped in a function and called. From there, I was able to isolate the issue, giving the minimal example shown in the link above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions