With only 512MB of ram you must have a computer which is at least 10 years old. With that said 4GB of ram is standard now a days. So its time to start looking at a new pc or upgrade your ram. If you upgrade your ram bump it up to 2GB. As far as Avast which version are you using? Are you running any other security? What is your internet speed?

http://www.crucial.com/