restart problem

I have problem with our Arduino Mega 2560(not genune). When we embed the code previosly it worked well but when we changed one DC motor with the new one it misbehaves such that the program works for a while and after Arduino restatrs itself and whole system returns to start again. I think that may be because of input power but the ON light on the Arduino does not change its brightness at the time instant it restarts.
We have powerd the Arduino by USB and 9V battery seperately. In each case the problem is the same.

What might be the problem?

(deleted)

spycatcher2k:
How have you powered the motors? Hopefully not with the arduino!!!!!!

Ofcourse motors are powered by another supply