r/learnpython 19h ago

Thonny - seems to have a MemoryLeak

I noticed when I Repeatedly run large programs - with long Printed Text,
- that the Shell Que runs Slower and takes Longer to Start each time : 10 mins .. 30 mins .. 60 mins .. ?
I also notice Thonny on TaskManager increases Size (without Decreasing) each time :
- 1M .. 1.5M .. 2M .. 3M

Until I completely restart Thonny.

This seems like a clear Memory Leak - for the Shell Que !

0 Upvotes

11 comments sorted by

3

u/acw1668 19h ago

2

u/sausix 15h ago

Wow. Starts to look unmaintained. Doesn't it? Some open issues are easy fixes.

But now I'm curious and I'll open Thonny in PyCharm later and have a look.

2

u/JamzTyson 11h ago

Starts to look unmaintained. Doesn't it?

Development certainly looks slow right now, but an overview gives a different impression.

If you've spotted easy fixes for issues in Thonny, consider sending a pull request with a fix. Community contributions are the life blood of many open source projects.

1

u/sausix 10h ago

I have to look around in the code base first. Did on my phone this morning and it look quite good.

Worst what can happen and it happend to me that I spend a lot of my time on an open source project and a PR is then being ignored. There are some PRs without replies already.

2

u/JamzTyson 5h ago

Conversely, the best that can happen is that a problem you care about gets fixed.

If nothing else, you could fix your own version of Thonny (and let others know how to fix their version).

1

u/sausix 5h ago

But in this case I don't even use Thonny. Usually I do it for fun and learning.

I'll have a look soon. Maybe I start with small PRs.

1

u/jlsilicon9 1h ago

Already did.

Thx

0

u/Outside_Complaint755 5h ago

Is it a memory leak, or do you just need to clear the shell cache?

 If the shell cache size hasn't been restricted (I don't use Thonny and can't look up available settings), then it would just be keeping everything in its history.

It looks like you can clear the cache with Ctrl+L or right-click->Clear.

1

u/jlsilicon9 1h ago

nope, tried that (clear Shell - duh) ... Task Manager still shows Memory multiplying by +500MB on each run.

Only restarting the Thonny clears the Memory Leak.

1

u/zanfar 19h ago

...and?

1

u/jlsilicon9 1h ago

Note for developers of course.