How long will data be stored in the memory ?

Stupid question: How long will data be stored in the memory without power ? I know the data is stored on flash memory so the it should be stored with no time limit.

The reason for my question: I've build a simple interface (4 buttons connected to my arduino ng) to controll a museum installation. Everything works fine at the beginning. But now after half a year the buttons didn't respond any longer. I uploaded my sketch again (and didn't change anything else) and now everything works fine...

Did the board "loose" the sketch ? What else could cause the problem ?

The chip is specified to retain program memory for over 100 years at 25 degrees C!

Did you try to reset the Arduino to see if the buttons would start to respond before trying the upload?

Also, check that your wiring is sound, you could have an intermittent connection that you inadvertently jiggled when you went to re-upload the sketch.

Is it running all the time? Could you have something like a list that wanders into other memory causing a lockup? Maybe a variable that runs out of range (ie a var that is declared an int but should be a long).

I've had trouble with AVRs and static before, certainly with the EEPROM, though this was a while back. Checking your grounding may be worthwhile. However I've never needed to re-flash the boxes for which static gave trouble.