Without all my serial output commented out, my sketch has stopped crashing. Let me elaborate on that a bit more...
For a couple of months now I've been working on figuring out why the AtMega side of my Yún stops working after a day or less, i.e. my sketch ceases to run while I can (often) still connect to the Yún's Linux side. I'm running the latest Open-WRT firmware.
It's a simple script that uses the AdaFruit TCS34725 color sensor to report its output in the void loop() via the serial monitor using Console.println. The strange thing is, that I'm finding a strong correlation with my Serial.println and Console.println commands inside the loop.
The sketch started out quite heavy on the amount of serial output it did, i.e. about fifty lines per five seconds or so. Essentially, I would output the HEX color code that the sensor reported. It was a lot of lines, and that way the sketch ran overnight, but I would always find it frozen the next day. I'd estimate that 12h was the maximum. I was troubleshooting my WIFI connection, and even tried a script that reconnects in case the connection is lost. I thought there might be a connection timeout of sorts, but that didn't seem to be the case.
At times I could see slowing down of the serial output printing, but I couldn't tell if it was due to me working on my laptop or the Yún slowing down. Restarting the sketch, however, made the board pick up speed again.
I then reduced the amount of lines printed to a single line per about 3 seconds or so using the Console.println command (I'm reading the output via WIFI). I could reliably run the sketch for about a day and nine hours. After that the Yún would fall silent and require a complete restart (plug it off the wall). The behaviour seems to be consistent and reproduceable.
Today, however is the third day of continuous, successful running of my script, and it seems it will just keep on going. The reason seems to be that I commented out all serial output. Otherwise the code has remained unchanged.
To my ultimate question: Does all the Serial.print and Console.print output get stored somewhere, eventually filling up the memory and causing the Arduino to crash? Do I have a limited amount of lines at my disposal, one line taking up about 6 to 8 characters of data? And ultimately: is this how it should work?