I have been experiencing a lot of lag when I play with mods even with OptiFine. So, with my 24gb ram laptop which has intel graphics, I tried to increase the default 2gb of allocated ram. But no matter how much more ram I allocate to the game, it won't use more than 2gb of it in-game. I tried to use the optimized settings in the Intel graphics command center as shown below, but it says I have to run the game at least once. I have played the game so many times already!
Before someone says this is a duplicate question, yes I am aware that there is a similar question here: Why isn't Minecraft using the full amount of RAM? However, he uses Nvidia graphics, which is different than the Intel graphics that I have. Thus, any ideas how to force MC to use more ram in-game to decrease lag (or other ways to decrease lag)?