What Could Be Causing Random Lag On Minecraft?

I'm trying to figure out what's causing lag in games like minecraft and recording software such as xsplit for videos for youtube.

Here's my current setup:
Mobo: Asus M5A99X Evo R2.0
Graphx: Asus Radeon R9 270 -2GB
CPU: AMD FX 6300 - 3.5GHz / 6 cores
RAM: Corsair Vengeance 2x 4GB (1600 Mhz)
Drives: 128GB Samsung 840 EVO SSD, 1TB Western Digital Black or Blue (I forgot)

Internet Speed: 30-35Mbps Download 5-10Mbps Upload

The random lag occurs on both multiplayer and single player modded minecraft after I have quite a few machines running simultaneously.

So knowing all of this, should I focus on adding 2x 8GB of RAM to my system?

Added (1). Also just to make it clear it's on modded minecraft, I don't lag on unmodded but still I want to figure out the issue causing lag so I can fix it.

And if it's not RAM that's causing the issue what might it be?

Don't forget what causes lag. It can range from slow internet, or too much data, to having to many programs active at once. Also, you have modified your minecraft, and some mods are still experimental.

If you don't already, it might help if you install 64-bit java and dedicate 4GB of your ram to it while playing. And it could also be that you need to lower your view distance to say 5 or 6. Other than that you need to understand that your system can run Minecraft Vanilla perfectly fine with no issues. When you mod the game and add mods you will experience a decrease in performance. I do as well and I have a 270x and an I7 -4770k. Adding 16GB of ram will not help honestly. I would look into the mods and they might have something in the configuration that you can disable to improve performance. Also I just read that comment that you added to BigBoiBlu and that could be chunk loading that is causing the lag. Dedicating 4GB of ram to Minecraft should solve or at least help it. Installing Optifine and tweaking in-game video settings will help greatly. You state that your system should be able to handle Minecraft on highest setting with no problem. That is true when you are only talking about Vanilla. Adding mods and Resource packs to the games etc will add another factor and can cause lag