my car, once in a while it will jump up to 3000rpm or so and say there until I either give it some throttle or put it into gear. How do I fix this? It doesn't happen very often, but when it does, it's very annoying. Any help is appreciated.

Car: 2002 Hyundai Elantra 5MT nearing 100,000 miles.