could be a lot of things need a good diagnostics scanner and live data see what you have, common is timing chain or r56 engines this will also cause 02 sensor upstream to over heat melt etc also cause it to trim fuel back if out of time etc all in a loop, but all this said need to start with a good diagnostics tool autocom cdp plus is hard to beat for the money on ebay £35ish