help with leaking memory management
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: help with leaking memory management
@bmarkus As mentioned above the best way to mitigate heap fragmentation in a running program is periodically to run gc.collect().
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: help with leaking memory management
After running a GC everything was fine until I had another infuriating small leak I couldn't track down.
After much grumbling to myself and not touching it for a few days I debugged my way into the GC and found I was getting a little carried away 'interning' http header values. Although the header key is a pretty good candidate for interning the head value certainly isn't!
Think, at the very least, the timestamp changes and when that different value gets interned you eventually run out of memory, slowly but surely. (LOLs go here).
Back to 100,000 requests no problems.
After much grumbling to myself and not touching it for a few days I debugged my way into the GC and found I was getting a little carried away 'interning' http header values. Although the header key is a pretty good candidate for interning the head value certainly isn't!
Think, at the very least, the timestamp changes and when that different value gets interned you eventually run out of memory, slowly but surely. (LOLs go here).
Back to 100,000 requests no problems.