Java parameters

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

spikeman168

New Member
Jul 29, 2019
14
0
0
What are some java parameters I can use to increase performance of my FTB Infinity Evolved/Skyblock?
Here's the set of parameters I already have up, and is it any good?
-XX:UseSSE=3 -XX:+AggressiveOpts -XX:MaxPermSize=128M -XX:+UseNUMA -XX:parallelGCThreads=4

I got these from 2 different threads, one was on this site back in 2013, and another back in 2014 on a different site. So, is this set of parameters still relevant, or out of date?
 

Hambeau

Over-Achiever
Jul 24, 2013
2,598
1,531
213
If you use Java 1.8x you shouldn't need any extra parameters at all. If I recall correctly the default RAM allocation was changed to 4GB and MaxPerm is now 256MB. There was a third parameter changed in 1.8 but I cannot recall what it was.
 

SevenMass

Well-Known Member
Jan 2, 2013
283
137
69
The Netherlands
Yes, those old threads are out of date. Mostly because Java 8 changes compared to older versions of java. For example; I happen to know that MaxPermSize is no longer used in java 8. (the java engine just ignores the parameters)
If you are still running old versions of java, then you can use the advice from those threads, otherwise, I'd advice to stop using them.

Also, if you are not using java 8, I'd advice you to start doing so.

Then the only parameter that is still of interest is the ram allocation. Both vanilla and and modpacks the size of FTB infinity run absolutely fine on 4 Gib (assuming your system has 16 in total, which is the norm on modern systems) This is assuming single player though, not servers.


PS: It appears I have been ninja'd, but I'm still going to post this...
 

GreenZombie

New Member
Jul 29, 2019
2,402
-1
0
These are the java parameters you need, and why:

* -server - only needed if you are running a server. When there is a GUI, its thread is typically priority boosted to ensure that it reacts quickly to user input. This turns that logic off.
* -Xmx3072m - the default memory allocation is based on the physical RAM the machine has and is sometimes not appropriate to the mod pack. Better to force it.
* -XX:+UseParNewGC - The default "new object" garbage collector is single threaded, and can cause delays when run that will interrupt your TPS. This enabled the 'parallel' multi threaded collecter for the new object heap.
* -XX:+UseConcMarkSweepGC - this parameter is not actually needed as the above parameter will automatically enable it. This enables a similar concurrent / multi threaded garbage collector for the older object heap.

I have not found any other settings that either make a difference, or have a theory behind why they should make a difference.

-Xms is useless as it effects application load only and its all but impossible to objectively prove that MC loaded a bit faster or slower or less or more glitchy: Memory usage very quickly stabilizes in practice.
-XX:MaxPermSize only applies to Java 1.7 and lower. If you are using Java 1.8 it will emit a warning saying its not used. Even when it is required on earlier Java versions, its foolish go set it to a big number. Setting it too low will typically cause MC to crash on startup, setting it too high will steal memory from the heap and impede performance. So you want it as low as possible such that MC doesn't crash on load.
 

spikeman168

New Member
Jul 29, 2019
14
0
0
These are the java parameters you need, and why:

* -server - only needed if you are running a server. When there is a GUI, its thread is typically priority boosted to ensure that it reacts quickly to user input. This turns that logic off.
* -Xmx3072m - the default memory allocation is based on the physical RAM the machine has and is sometimes not appropriate to the mod pack. Better to force it.
* -XX:+UseParNewGC - The default "new object" garbage collector is single threaded, and can cause delays when run that will interrupt your TPS. This enabled the 'parallel' multi threaded collecter for the new object heap.
* -XX:+UseConcMarkSweepGC - this parameter is not actually needed as the above parameter will automatically enable it. This enables a similar concurrent / multi threaded garbage collector for the older object heap.

I have not found any other settings that either make a difference, or have a theory behind why they should make a difference.

-Xms is useless as it effects application load only and its all but impossible to objectively prove that MC loaded a bit faster or slower or less or more glitchy: Memory usage very quickly stabilizes in practice.
-XX:MaxPermSize only applies to Java 1.7 and lower. If you are using Java 1.8 it will emit a warning saying its not used. Even when it is required on earlier Java versions, its foolish go set it to a big number. Setting it too low will typically cause MC to crash on startup, setting it too high will steal memory from the heap and impede performance. So you want it as low as possible such that MC doesn't crash on load.
Do I use all of these Java parm's in the launcher advanced settings, like the "-sever" one, or is the "-server" parameter supposed to be in the server startup bat file? Also, how would the threads parameter be out of date? And, would it be of any use to me if I used "-XX:+UseConcMarkSweepGC" and "-XX:+UseParNewGC" at the same time?
 

GreenZombie

New Member
Jul 29, 2019
2,402
-1
0
Do I use all of these Java parm's in the launcher advanced settings, like the "-sever" one, or is the "-server" parameter supposed to be in the server startup bat file? Also, how would the threads parameter be out of date? And, would it be of any use to me if I used "-XX:+UseConcMarkSweepGC" and "-XX:+UseParNewGC" at the same time?

The flags used in the launchers advanced settings are the ones that Mojang have determined yield good performance. As such I usually keep them "just in case".

"-server" should only be added to the server start batch file.

I try to leave out things like specifying the exact number of threads as java will usually try to pick sensible defaults, and specifying things like that is very sensitive to the number of cores, the exact CPU and load characteristics at the time that profiling was done. Setting ParallelGCThreads is just as likely to inhibit performance as improve it.

I prefer to use both at the same time as the fact that the one automatically enables the other is documented only in a blog post that doesn't seem particularly authorative, is hard to find, and I can't actually remember if UseConcMarkSweepGC enables UseParNewGC or the other way around.
 

spikeman168

New Member
Jul 29, 2019
14
0
0
The flags used in the launchers advanced settings are the ones that Mojang have determined yield good performance. As such I usually keep them "just in case".

"-server" should only be added to the server start batch file.

I try to leave out things like specifying the exact number of threads as java will usually try to pick sensible defaults, and specifying things like that is very sensitive to the number of cores, the exact CPU and load characteristics at the time that profiling was done. Setting ParallelGCThreads is just as likely to inhibit performance as improve it.

I prefer to use both at the same time as the fact that the one automatically enables the other is documented only in a blog post that doesn't seem particularly authorative, is hard to find, and I can't actually remember if UseConcMarkSweepGC enables UseParNewGC or the other way around.
This reply may be a bit late, and considered necro, but I had a few problems with my computer, all fixed now. Thank you for your help.