Engine knocking/pinging on 2002 Nissan Maxima

I have an intermittent knocking/pinging noise in the engine. I only use premium gas and the problem has slowly increased over the last 2 years. Does not occur during excelleration from a start, but rather when I am at cruising speed and am slighlty on the gas. Replaced an O2 sensor three years back when the check engine lite came on. Have since had the car at the dealer for two days and they said everything "checked out" but recommended I replace the engine, but could not explain why the noise was happening. Any ideas?

Asked by for the 2002 Nissan Maxima
i had a similar problem my car would knock and ping when i was crusing and then when i would accelerate it would go away the problem for me was i only had 1 quart of oil in my car all i had to do is fill my oil back up again but if this is the case then you probably have an oil leak
1 more answer
This car's known for your issue; mine does it, too. It is not an easy fix. Some have suggested flashing (i.e., reprogramming) the Engine Control Unit (ECU), but it's no sure fix and can be expensive, so I've heard. Cleaning the Mass Airflow Sensor (MAF) works for some, but again it's no sure thing. Your description does NOT seem to indicate the need for engine replacement. Have the dealer check the engine timing (that is, the "static" timing at idle, as well as the on-board computer's dynamic adjustment of the timing when the engine is run at a higher, say 2,000, rpm level and ensure it's OK. Do your due diligence, but expect to have to live with this issue, as many of us owners on the Web have complained about!