I have tried many JVM arguments circulating on the internet, and made some modifications and finally found the right combination, hopefully, this post can improve the experience of playing modded Minecraft which is known to be very heavy.
CPU: i5-6200U (2 core 4 Thread Boost 2,7 GHz) (Because of this CPU playing Minecraft without JVM argument is not playable)
GPU: GeForce 930mx (ON javaw.exe)
RAM: 12GB 2133 MHz (2 slots)
OS: Windows 10 Home 64bit Build18363
Modpack: E2:E Singleplayer (with addition performance mod surge, vanillafix, phosphor, optifine) I suggest adding these mods to help increase fps, in my case 50 to 120 more
(Render: Fancy, Smooth Lighting: Maximum, Render Distance 12 Chunks ( the settings default to the mod pack) With Optifine default)
This test is based on a qualitative test with additions
After making modifications, this is the smoothest argument, opening Minecraft is also faster, when opening the map there are several lag spikes and the rendering takes a long time to load at this time all CPU cores are 100% RAM consumed ~ 3.5GB, but after a few seconds when all cores CPU starts down to 30-50%, everything runs smoothly, almost no problem, rendering map fast(kinda) and also almost no lag spike (The longer it plays, the faster loading) RAM drops to 2.4 ~ 3GB (loop due to Garbage Collection) The average fps is at 120 and above, and I can still open the browser to play youtube videos or twitch with the pop-up facility so while playing.
-XX:+PerfDisableSharedMem -XX:+ParallelRefProcEnabled -XX:+AlwaysPreTouch -XX:+TieredCompilation -XX:+UseBiasedLocking -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseNUMA -XX:+UnlockDiagnosticVMOptions -XX:ParGCCardsPerStrideChunk=4096 -XX:+CMSParallelRemarkEnabled -XX:MaxTenuringThreshold=1 -XX:MaxGCPauseMillis=50 -XX:GCPauseIntervalMillis=150 -XX:InitiatingHeapOccupancyPercent=15 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -XX:+UseBiasedLocking -XX:SurvivorRatio=32 -XX:TargetSurvivorRatio=90 -Dfml.ignorePatchDiscrepancies=true -Dfml.ignoreInvalidMinecraftCertificates=true -XX:+UseFastAccessorMethods -XX:+UseCompressedOops -XX:+OptimizeStringConcat -XX:+AggressiveOpts -XX:ReservedCodeCacheSize=2048m -XX:+UseCodeCacheFlushing -XX:SoftRefLRUPolicyMSPerMB=10000 -XX:ParallelGCThreads=4
Next, Opening minecraft is longer, opening the map is also heavier, there is a lot of lag spike but after a long time it starts to get lighter and the map rendering is faster than the previous argument because all CPU cores are stuck at 100% RAM 3.5 ~ 4.5 (Looping) fps 80-100, the laptop is hotter (I think this argument is suitable for high-end, but the rendering looks like a rush to force it to be realtime) with this argument can not do multitasking like opening a browser because the load is too heavy
-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1
And many more arguments but the change is not too significant must be between the two arguments above (the above argument uses a different method of doing GC so I try to combine them to get the best results ie in the first argument, I will try to modify it again so that the CPU can be used atleast ~ 80% of each core, I see in the first argument there is still a lot of CPU potential that has not been used optimally so sometimes the rendering takes a long time.
When I found this argument I finally got to enjoy the game, Happy exploring…
I forgot (1):
I use MultiMC and set a minimum memory allocation of 752MB, maximum memory allocation of 8048MB and PermGen of 512MB (I recommend using my minimum value, because if set high Minecraft will take up a lot of memory at the start of the entry, this can be suppressed by setting it low I can see that my maximum value is only 8048 MB. I have tried to set it higher, for example 10096 MB, but this doesn’t really help, there is a periodic lag spike because Minecraft almost takes up all of my system memory (if I set 6048MB the same is still smooth) means setting it is too greedy not good either, to find the maximum amount of memory you can add little by little until in the task manager you can see the RAM memory used is already 90% use the value when this happens), about the PermGen I’m not so sure but I feel an increase if I set it high to 512MB but after that, there is no improvement anymore (what I mean is to reduce lag spike).
If you use a different launcher from me, this can also be done manually by adding this at the beginning of the argument above
-Xms752m -Xmx8048m -XX:PermSize=512m -XX:MaxPermSize=512m If you use the same launcher MultiMC, and have set it, there is no need to add this code