Minecraft is Lagging after refreshing computer. How do I fix this? Quick reply?

Okay a couple of days ago, I refreshed my whole computer because I noticed started to get all these weird ads and everything. My minecraft was averaging about 120 Fps-200. But when I re downloaded Minecraft AND added more Ram + updated Java it's averaging about 10-20 Fps.

Specs:
Intel(R) HD Graphics 4000
8GB of RAM
Allocated memory to minecraft: 6GB
Updated Java

If you allocate too much RAM to minecraft then minecraft will lag like sh! T lol xD i'm sorry but it's the truth. Even though it seems that minecraft would run faster with more RAM to use but the RAM is going to a waste. Minecraft only needs 512mb to run normally vanilla with a few mods. If you have the shaders mod(which is a graphics mod which brings intense graphics) then you would use 1-2GB ram at most. Using more RAM then that is pointless. Try to allocate about 1GB or 512mb to minecraft and it should fix the problem.

Make sure all your drivers are up to date