  We propose a system made of three quantum harmonic oscillators as a compact
quantum engine for producing mechanical work. The three oscillators play
respectively the role of the hot bath, the working medium and the cold bath.
The working medium performs an Otto cycle during which its frequency is changed
and it is sequentially coupled to each of the two other oscillators. As the two
environments are finite, the lifetime of the machine is finite and after a
number of cycles it stops working and needs to be reset. We analyse the
entanglement and quantum discord generated during the strokes and show that
high work generation is always accompanied by large quantum correlations.
