Go Down

Topic: Program corruption? Inconsistent and odd failures mid-program (Read 2 times) previous topic - next topic

James C4S

Quote
Every single print action(even moving the cursor), repeated or otherwise, consumes more RAM that it never frees up again.


How are you determining that?  You might be working with a flawed test (or flawed assumption).
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

thehobojoe

I was using the memory test library from this page, and testing the memory after every print action. The amount of memory consumed was consistent with the number of characters in the string, and the failure rate was also consistent with my previous testing of the problem. So at this point I'm fairly confident that the problem is the RAM not being freed up after being used to print a string. I'll keep combing my code, but if anyone has any experience with this, it would be really helpful.

AWOL

Quote
o at this point I'm fairly confident that the problem is the RAM not being freed up after being used to print a string.

What memory would the "print" methods use, other than the supplied buffer to be printed and stack?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

thehobojoe

I'm not entirely sure, as they're functions provided by the GLCD library, something which I'm also digging through, although I'm not sure that's the source of the problem, since I've made multiple programs using it, even ones that are very string heavy, and this has never been a problem before. I'll try to find the relevant functions in the library and post them here.

thehobojoe

I moved all my strings to RAM using "GLCD.printFlash(flashStr("string"));" as per the suggestion of the GLCD library author, and while it freed up a few hundred bytes, it didn't change the problem. The program is still consuming large amounts of RAM every time there is a print action, and never freeing it up later. I'm clueless as to what the problem could be at this point.

Go Up