NewBee - unknown "possible" memory leak? #3936
Replies: 1 comment
-
Posted at 2014-06-28 by @gfwilliams Hmm. I'm not 100% sure if it is a leak... usually leaks cause 1 or 2 vars to be lost each time, so the loss is often a lot more drastic. Maybe check in another day and see if it has got worse? It could just be a variable that is storing a larger string than usual. Posted at 2014-07-05 by user7114 "One drip from a water faucet can be gallons/liters of water per week" An Espruino " very slow memory leak" from variables can also be troublesome. Posted at 2014-07-05 by @gfwilliams Are you running the latest 1v66? I found a memory leak in the serial port receive handler (which is fixed in that). It's possible that a little noise gets on pin A10, is interpreted as a character, and then causes the leak? If you are still hitting problems with 1v66, are there any error messages shown? It's possible that some error when accessing a file causes a leak. Otherwise, if you can find something that increases the rate of leaking memory, it might be a hint as to what the problem is. Posted at 2014-07-05 by user7114
Yes, Last week I just obtained 1v66 and had to reload the firmware.
I not sure I understand. The data logger program (above) does not even use A10?
Without the computer connected to the Espruino, there would be no way of telling? Maybe, its the 1-wire "12 bit" DS18B20 and I will try substitute this temperature sensor with a constant? Posted at 2014-07-05 by @gfwilliams
No, but when USB is unplugged, Espruino automatically switches the console over to use it. I just tried randomly poking the board around A10 and memory usage rose - it could be the problem. Please could you look at The buffer for Serial1 is 'only' 256 bytes or so so it won't ever stop your code from working. I'll see if I can do something about it though - perhaps by not storing the data unless someone has previously called Posted at 2014-07-05 by user7114 Ok, Serial1.available() reads 0(zero) on the I2C LCD 4x20 display when the Espruino Note: The I2C LCD display comes in extremely handy for troubleshooting an Posted at 2014-07-08 by user7114 After a few days of 5 second temperature logging, the memory usage units increase from 657 to 667. The Serial1.available() still had zero on the LCD display. <----- The "possible" very slow memory leak might be comming from any of the sensor or devices. I2C LCD, I2C RTC, 1-Wire DS18B20 or the buit-in SD card? It could be even in program, module or firmware? New memory leak testing changes: After a few days of testing, the memory "unit" usage again increased by 10 and the Serial1.available() still stayed at zero. Still no help - any suggestions Espruino: v 1.3: firmware: v 66, WEB-IDE: v 45, Windows 8.1 / Chrome Posted at 2014-07-08 by DrAzzy Sounds like it's down to either I2C (for the screen), or the SD card access. I assume you've verified that the log files are clean? That would be something to check - if it's being caused by SD card access, maybe you'd see a sign of it there... Posted at 2014-07-09 by user7114
The data on the SD card seems OK Since I posted the code (above), if someone else could run and verify the same memory leak problem? After all, the complete DS18B20 logger is hooked up on a "capacitance" breadboard and the problem could be hardware. Posted at 2014-07-09 by @gfwilliams Right, I guess it's unlikely to be Serial1 then. Can you try changing:
to:
and removing the code you have below that also sets those sensors up? When you write Can you also try typing Posted at 2014-07-09 by user7114
Here's the problem ... On another very minor issue ... Test code ...
Posted at 2014-07-10 by @gfwilliams All you have to do to avoid the setup issue is to specifically put a call to If you're having the issues with the buffer overflowing then that could have been causing the leak (especially under 1v65). For now, try adding the line Posted at 2014-07-11 by user7114 @gfwilliams... I did everything what you instructed (above) "to the T" BTW ... Its cool to have the Espruino to tell the user that the Update ... after four days of remote logging testing, the memory usage did Posted at 2014-07-14 by @gfwilliams Great! Glad it's sorted! In the 1v67 release I've actually added that pullup by default too (so you won't have to explicitly add it). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-06-28 by user7114
Being a hard core Arduino user, I decided to switch to the Espruino.
I put together a DS18B20 data logger. After a few days, I noticed
on the I2C LCD, that memory usage was increasing from 646 to 651.
Any help is appreciated to track down this memory leak. (See code below)
BTW ... I am very impressed with the amount of program code needed for this project. It would of taken thousands of lines of code for the Arduino.
Beta Was this translation helpful? Give feedback.
All reactions