So long story short, before I had a vanilla Minecraft server with Minecraft running at the same time.
I allocated all of my ram (16gb) to Minecraft just so it had enough room to breathe. Of course it doesn't use that much, it uses max 3gb but somehow it actually increased fps even though Minecraft wasn't using all of the allocated ram.
Also, I should mention even with Minecraft and server running I had chrome open with quite a bit of tabs (like 20) and even Spotify playing songs and it was running fine at 144fps with optifine and max settings. (should mention I have a gtx 1080 and i7 10700k OC to 4.9ghz)
But yesterday when I tried to launch Minecraft after launching the server I got a blue screen of death. After that screen whenever I tried to launch Minecraft it would say not enough memory until I lowered the allocated ram to about 6gb.
Also now even when I would launch the server (which uses only like 1.5gb of ram) and launch chrome, chrome tabs would begin to crash saying they are out of memory.
And the worst thing now is that I cant run Minecraft and the server at the same time cuz one or the other crash saying there is not enough memory even when I close all other applications and RAM usage is literally only 30%. Also with 6gb of ram Minecraft barely runs at 60fps.