I want to play a game (Half-Life 2) and I need my RAM to be completely free for it.
Shutting down Avast will not free up much ram and won't lead to a smoother game.

Putting in more physical ram and/or getting a better video card is the solution for you.