How can I clear the history in a session?

Greg:

I’m not yet a Wolfram Language expert, but if the Wolfram Language works like other languages that I’ve used, then you should might be able to use Block, With, and Module to scope your variables that require lots of memory.

This post might help.