Firstly you are spot on by adding more ram,256MB is not enough for xp really.
I dont think the ram is the problem that causes the freezing while online.
Firstly run Ccleaner click here and any antivirus/anti spyware programs you may have. (if more advice on this is needed,just ask)
Post back if the problem persists.