I am having the same problem, but my servo runs off a separate power source. I have the Arduino running off usb, and the servo running off a 6v bank of AA batteries.
Everything ran fine when I first got it. But after just a few days, the servo started going haywire. It swings back and forth despite receiving no commands from the processor.
I'm a noob, and I'm just practicing and testing code as I learn. So to be sure I wasn't at fault for this, I used the standard "knob" and "sweep" sketches that come with the Arduino software. Same thing happened.
I suspect this could be a counterfeit servo. After ordering my TowerPro MG995, I started seeing several articles warning that they've been so widely counterfeited that it isn't recommended to use them at all. I do not know if this is the case with mine.
This seems to be a widespread problem, if what I've read is true. How do you know you're ordering a genuine product?