By replacing Chua's diode in the canonical Chua's oscillator with a smooth flux-controlled memristor, a memristor based oscillator is presented. The memristor oscillator generates a steady periodic orbit and has a transition from transient chaotic to steady periodic behaviour. The complicated dynamical behaviour is extremely dependent on the initial condition of the memristor.