Hey, I was hoping that you all could help me with a problem?

I have desktop pc with Windows XP on it for a year and all was fine. Recently, when it started acting slower, and less effiecient with the memory. I figured that it was probably some spyware or a virus. I did a couple of sweeps and low and behold it was a trojan. I quarantined then deleted the virus, thinking that the problem would be solved. Well a short time later, I started recieveing messages about low virtual memory, and then as I was checkning the C:\ folder of my computer I realized that there was only 5.99 GB of memory total! This is out of 55 GB that it had when I bought it some time earlier. I re-formatted my C:\ drive, thinking that may solve the problem. It did'nt. Upon closer inspection I realized that there was a buffer overflow. Now I am wondering can it be fixed manually, and if so what hardware should be bought? And to top it all off I am still not sure if the buffer overflow was the real problem. Maybe the virus? I am kinda stupped.

Any advice on how to deal with this would be greatly appreciated.
Thanks