-
Notifications
You must be signed in to change notification settings - Fork 32
XBee 3 Cellular LTE-M/NB-IoT - memory leak #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sorry, I forgot to attach the test data. Thanks, |
The MicroPython garbage collector is very conservative, so a small "memory leak" while in an execution loop isn't really concerning, as long as the GC is able to collect that memory later. Do note that all the calls to e.g. Have you tried testing what happens if you replace the sleeping logic (everything from |
Latest update: I have attached my latest code, which is a bit cleaner. As you suggested, I replaced the x.sleep_now(x, False) with just a time.sleep_ms(x). Where x = 120000. This seems to work without leaking a single byte. If I only swap out the time.sleep_ms(x) with the x.sleep_now(x, False) I once again start dropping bytes every few times through the loop. Thanks, |
Hello,
I am running a small micropython code loop on XBee 3 Cellular LTE-M/NB-IoT hardware, firmware version 11415. Using examples from the digi documentation and GitHub I simply instantiate a XBee and a network object, test network connection, calculate my next wake up time and then force sleep. Things are running fine except that before I sleep I look at my free and allocated memory. Then I run garbage collection and then look at the memory again. I'm noticing a small memory leak. Its not every time through the loop but over time it adds up. My solution as of now is to set a threshold level and safely shutdown the cell module and reboot. Just wondering if anyone can help debug where I am going astray. Attached is a txt file of my code.
main_py.txt
Thanks,
Kris
The text was updated successfully, but these errors were encountered: