Break in serial communication with PC

Hi, I'm having problems with the serial communication between my arduino mega and the pc.

My project prints information on terminal every minute until it reaches a break point that is printed on the terminal and are led turns on. Here is the problem a couple of times the serial communication was lost at random times, for example at 1 hour of running or 6 minutes.

I tried using other terminal like putty and eventually the communication stopped. I thought that maybe it was a problem of energy since i was supplying 9V through the power jack and also connected through the USB port but i tried only connecting the USB and that didn't help.

It's not always happening since there were times that it run for an entire day but it is something i cannont control and i would like to solve it. Did anyone had the same problem? If someone has an idea of a solution I would be very thankful

Haven't you forgotten something (s)?