Memory leak
-
Hello,
If you load a module (that contains a class inside) , the memory is not freed. Here is an example:
PYB: soft reboot
MicroPython v1.8.6-412-gf55ba50 on 2017-01-28; LoPy with ESP32
Type "help()" for more information.
import gc,sys
gc.mem_free()
58432
import onewire
onewire loaded
gc.mem_free()
54128
gc.collect()
gc.mem_free()
54320 <<<< 4k still out
del sys.modules['onewire']
gc.collect()
gc.mem_free()
54368
import onewire
onewire loaded
gc.mem_free()
50800 <<<< another 4k out
import onewire
gc.mem_free()
50640
del sys.modules['onewire']
gc.collect()
gc.mem_free()
51088
import onewire
onewire loaded
gc.mem_free()
47520 <<<< another 4k out -
please reformat your post
look here for format guide
http://commonmark.org/help/but your observation about eating memory should be reviewed by @daniel
-
Thank you. Looking forward for some workaround on this .
-
Has this issue been solved? I'm getting similar problems with threads that don't free-up memory after finishing execution. My version is:
>>> os.uname() (sysname='LoPy', nodename='LoPy', release='1.13.0.b1', version='v1.8.6-849-656704e on 2018-01-10', machine='LoPy with ESP32', lorawan='1.0.0') -
@ea If you are dealing with threads ... then might be another story. Do you have memory leaks on main execution? I tested on my LopY and everything works fine.
-
Hi @colateral. Thanks for replying. My
MemoryErrorissue was reported in https://forum.pycom.io/topic/2600/threads-generate-memoryerror-when-there-s-an-empty-while-cycle-not-necessarily-infinite/6
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login