Some of what has been posted is not entirely accurate and there is a much faster method to clear the KAM (Keep Alive Memory).
The KAM can be reset using a capable scan tool in a few seconds. If you don't have a capable scan tool disconnecting the PCM (computer) for 10 seconds will also work. Another method is to remove the positive battery cable and connect a jumper to the positive battery cable end to ground for 10 seconds.
If you leave the battery disconnected for a long enough period it will reset the KAM provided the back-up power supply is discharged. The backup power supply is mainly used for the air bags, but it will feed other modules for a period of time also.
It should also be noted that anytime you load a new tune into the PCM the KAM is reset also.
It normally takes about 50 to 100 miles for the PCM's adaptive strategy to relearn. When you 1st start the car after resetting the KAM you should let it idle a couple minutes with everything turned of in park/neutral. Then turn the a/c on for a few mins, and after that put the vehicle in gear for a few mins if you've got an auto trans. When your done relearning the idle strategy, drive the vehicle like you normally would. I do not recommend driving it in a manner out of the ordinary at this time.