Minecraft Lag Spikes

I already have Optifine installed, and I've tried doing lower resolution resource packs, turning down my settings, and all that. I also know that I can allocate more RAM to Minecraft, but I only have 2 GB of RAM. I have allocated some more RAM in MB instead, however, max RAM isn't really the problem. The thing is that I randomly take lag spikes, or my computer beeps at me and doesn't allow me to do anything for 2-3 seconds, which is REALLY bad when you're in the middle of a PVP battle. I already know about the RAM, Optifine, and Priority. But I still get lag spikes, and something I seem to can't control, is the computer beeping at me and not allowing me to do anything at completely random times.

So I was just wondering if there was at least a way to stop the beeping, or both the lag spikes and beeping.

OS: Windows 7 Ultimate

Processor: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ 2.00 GHz

RAM: 2.00 GB

SystemType: 64-bit


Solution 1:

Regarding Frank's comment, I've done more research and found that many users have a RAM issue with Windows 7 because the OS will take up most of it on launch. Here is one of those users. This specific person loses 1.6GB to the OS.

You must have a lot of RAM left over if you want to not experience lag spikes in Minecraft, or any game. Once you get more RAM or upgrade to Windows 10, you should no longer experience these lag spikes.