would a soft reset help fix a memory leak?

Status
Not open for further replies.
Hi all,

I have a fairly large/complicated project (two teensy 3.6's running six stepper motors in synchrony) and it's all working great... mostly.

It works flawlessly for an unknown period of time –*at least a few days –*and then mysteriously stops. Which feels to me like a memory leak, especially since if I reset both teensys via TyCommander, it starts up again fine.

I know that the REAL answer is to pore through the code line by line and try to figure out where the dynamic memory allocations are not being freed, but since I'm limited in time and resources, I'm thinking that I may instead (or, first) try and implement an automatic reset, once a day, and see if that's enough.

I found this thread, which I imagine works, but will this have the same effect as a "hard" reset in terms of memory? Or should I need to build in an external hardware watchdog to be sure?

Related, anyone have any good recommendations for a hardware watchdog or timer?

Thanks all!
-Sam
 
Yes, doing that CPU_RESTART will reset the processor and enter setup() with memory and state restored the same as TyCommander's GUI Reset.

A post in recent days linked to a memory monitoring thread/post, and there are others that may help determine when resources are being used.
 
Awesome. Thanks as always for the speedy and helpful response!

And yes, I was looking at a couple posts to that effect as well... I'll do some more digging...
 
Status
Not open for further replies.
Back
Top