How to: Track down runaway Mac apps
. . .
If you see an application that's consuming 99% CPU, such as 'meanapp' in the above example, it's probably the cause of your overheating and laptop sleep issues. Scribble down the process ID of the app (in this case 1047), type "q" to exit top, and force the application to quit by typing kill -9 1047, where 1047 is the troublesome process ID.
If this becomes a regular issue, track down the application that's consistently causing you problems. Chances are it's a third party application or driver that could use an upgrade.