For a few months now my 1999 Toyota Avalon XLS (California model - this apparently affects the emissions specs - I'm in NY however) with around 105k miles has been giving me these totally random periods of revving at idle between 500-750 RPM (sounding like a cat purr) and then continuing that feeling when I'm diving and I'm coasting or easing the engine (but not accelerating).
I ran my code reader on the car and kept getting a P0171 (engine running lean) code so I pretty much (over a period of a few stages) replaced my MAF sensor, tested all the O2 Sensors, replaced a faulty ignition coil - and I replaced my intake manifold gasket and the O Rings for my pistons.
The reasons we had the gaskets and O-Rings replaced is because using a Vacuum Gauge and air compressor allowed us to find some leaks in those regions. Additionally I inspected my timing belt and it looks perfectly fine so I'm pretty sure that isn't really the cause.
While all these replacements cleared the check engine light to date, today I started to experience the revving again - which actually lasted for probably an hour of driving on the highway (even after letting the engine rest for a couple of hours) - then stopped temporarily - and then ten minutes later resumed literally as I pulled into my driveway.
Although I tried running the codes twice today - my reader is now saying everything is A-OK. The serious issue with this problem however is that it happens sporadically so it's hard to recreate the issue at the right time. ' As my car is approaching inspection I'm trying hard to fix this issue myself (if possible) because since the P0171 (running lean) code has so many possible causes, it's literally a matter of trial and error for the repair which can cost well over $1k at least from what I was quoted by the dealer (and also from my research on parts and labor online).
Any assistance with this is greatly appreciated.
UPDATE: Took my car in for inspection and it passed with flying colors but the issue is now even worse. I think the technical term for the symptoms are "hunting" and "surging" - I believe my car is experiencing both.
The engine reving/surging/etc. is now getting worse to the point that my engine has stalled when idling in traffic and also I had to crank the engine a few times to get it started again.
I'm now thinking of changing the fuel filter but I'm not sure if that will help since this issue is always random.