Can't you just disable the real-time shields? I recall the memory usage drops a lot as you disable them.. Or, not tried it but what happens if you stop the avast services?
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***