question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Memoryleak in Pythonista 3 and 2.1

See original GitHub issue

There seems to be some sort of memory leak in StaSh. When entering a command or an empty line in the StaSh commandline, the amount of objects in gc.garbage increases (write gci status to the StaSh prompt to get the amount of garbage). When setting the debuglevel of the garbagecollector to DEBUG_LEAK, it will print a huge list of uncollectable objects, most of them appear to be some UI-Buttons on objc-level (write gci debug 62 to the StaSh-prompt to set debug to DEBUG_LEAK). I have tested this with Pythonista3 (2.7.5), Pythonista 2.1 and 2. Pythonista 2.0 does not seem to have any issues. Pythonista3 and Pythonista 2.1 have memoryleaks when running StaSh. Running normal scripts outside StaSh does not result in any memoryleaks. The size of the garbage exeeds 1MB pretty fast. I have tested this with the ywangd/dev branch.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ywangdcommented, Aug 5, 2017

I am not working on new releases. Simply do not have any time for it at this stage …

0reactions
bennr01commented, Jan 17, 2018

@steljas sorry for the delayed response. It appears like this was a bug in the pythonista UI module related with keyboard inputs (the increase in garbage was proportional to the numbers of keys pressed since the last check) and was fixed a few weeks later in a pythonista update. Thanks for reminding me to close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Possible memory leak in ui.ImageView · Issue #244 - GitHub
I am trying to create animations by displaying a sequence of JPG images. My code consistently crashes Pythonista after a few hundred images....
Read more >
Get available memory | omz:forum
I am looking for a simple way to check a memory leak, and therefore would like to check the available memory regularly.
Read more >
What are some common patterns of memory leaking ... - Quora
Python is garbage collected, so any memory that can't be reached anymore will be freed, So memory leaks are only possible if the...
Read more >
Diagnosing and Fixing Memory Leaks in Python - Fugue
Looking at memory usage showed that the reflector's memory footprint increased monotonically and continuously, indicating a memory leak.
Read more >
Finding and Fixing Memory Leaks in Python
Objects such as arrays and strings grow dynamically as needed and their memory is cleared when no longer needed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found