Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
firstly, that's way too much ram to allocate (unless running 200+ mods with high textures/shaders). 3-4G is plenty
your issue is caused by OptiFine: https://discuss.aristois.net/topic/13/how-to-uninstall-optifine-optifine-error-on-startup