I have 8 Gb of ram and I have 7 paritions system. Actually the use of RAM by AVAST has diminished by itself, you are right but after a long time...
But I do not understand the interest of scanning disks (randomly?) after any program installation ... Avast does not scan the newly created directory of the new program but scans all over the disk. I can see the input / output paths that avast reads with a program ...
And its excessive use of CPU take time, long time ...
The Operating System controls the management of the ram but the program (in language C for example) can indicate to destroy objects in memory formerly created and not used.
Optimizing the memory management of a process in memory is already done during development by programmers.
And I'm not saying that Avast's development team did a bad job, they are very competent !

I explained a clarification on "I was under the belief that your OS controls RAM usage".

Thank you for your explication ^^