This isn't a hard drive issue, this is an issue where you have too much stuff running in the system memory. AJ's suggestion is good, but it's only a start. Look over all the software you have installed and also have a look at the notification tray (the group of icons down by the clock in the lower right corner of the screen).
Also, you don't mention what operating system you are running. Are you running XP or Vista? Ever since service pack 2 512MB has been marginal for running XP and it's not enough to run Vista. Especially if you're using a video adapter that is built into the system board. Integrated video adapters use a shared memory system for their video RAM, which means they steal it from the system RAM. If this is the case then out of the 512MB you have you're loosing 32-128MB to the video system. That isn't helping your situation.
After you have cleaned up your system, I would recommend increasing the system memory. If you plan on running XP until you replace the PC then I would increase it to at least 1GB. If you ever plan on upgrading to Vista then go for 4GB if your system will take it, but depending on how old this PC is that might not be cost effective.