The RAM isn't your issue, not by a long shot. The amount of RAM isn't going to have a major impact on online play or lag (assuming you have enough to run anyway).
First: What do you mean by "high" that's kind of subjective. 2Gb, 3Gb, how much exactly? And what's using it, the game or something else?
Second: Is there anything running in the background that could cause these issue? I used to have similar problems but I found it was a background program that was running that would occasionally try to download updates that caused lag issues.