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
-
Hi @colateral. Thanks for replying. My
MemoryError
issue was reported in https://forum.pycom.io/topic/2600/threads-generate-memoryerror-when-there-s-an-empty-while-cycle-not-necessarily-infinite/6
-
@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.
-
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')
-
Thank you. Looking forward for some workaround on this .
-
please reformat your post
look here for format guide
http://commonmark.org/help/but your observation about eating memory should be reviewed by @daniel