Sounds dreadful. My first thought was O2 sensor. But if it cycles up and down from cold, that can probably be ruled out. Stuck idle control valve or bad throttle position sensor (if it has one) would be my next guess. Lastly, the coolant for air temp sensors.
'Symptoms of a bad throttle position sensor' and link to O2 sensor fault finding here:
https://www.bimmerforums.com/forum/s...osition-Sensor
http://www.lambdapower.co.uk/diagnos...c_index.asp#q3