JVM Arguments for Modded Minecraft (Updated 12/30/13)

  • 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

Darkmega

New Member
Jul 29, 2019
18
0
0
Go into the java control panel and be sure you don't have parameters set there.

I don't. I had already checked there sometime ago when I was making sure that the right java version was being used. theres no parameters being set on it... only parameters ever being used are the ones I try to put into the game for the launcher. I swear the it's the update 45 or something, cause I could do this stuff before I updated java...

edit:
ok, so, make heads or tails of why this happens.

mh52.png


I'm guessing arguments that come afterwards take precedence over the original ones... so I'm guessing that xmx1g and xms1g at the end is being thrown in by some random thing (not from my control panel, cause I checked, triple checked and multi-checked for arguments in there) and its causing it to default back to 1G despite my mem setting things there.
 
Last edited:

Darkmega

New Member
Jul 29, 2019
18
0
0
erm... i, have no clue :(

Atleast you're honest... So you're not having this problem at all? or someone didn't accidentally do something in the launcher at some point that could've done it? I know it's a lot of finger pointing but it's all I've got, since I've tried lots of different mixtures of non-argumented, argumented, un-install, re-install, restart, try to counter it with arguments in the control panel by default, google this, google that and wishful thinking but nothing is getting rid of it. -_-'

edit: hey. heyheyhey, guess what? I fixed it. despite not remembering putting it there there was something in my advanced computer options in the environmental variables which was _JAVA_OPTIONS and that was the thing doing the self resetting 1G thing (it was probably put there by java when it first got reinstalled I'm gonna venture the guess? because I certainly wouldn't purposefully lock myself to 1G when I know full well I always play minecraft with enough mods to instantly crash itself upon loading with only 1G available. >_>) I saw it when I went into my command prompt earlier today to check my java version with cmd at the recommendation of something i noticed somewhere on google to double check my version. but I didn't pay any notice to it, but I randomly did it again just now and saw it and then that java options heading stuck out. so I looked it up, about 5 minutes of fiddling later saw a video pointing me to the environmental variables thing in advanced options and nuked it and boom, back to normal.

So yeah, I'm all good now. So uh, yay. :D no lag at all now that I've got the memory loaded up and it's sitting at 50% instead of 90% >_>. and fun thing, whether you believe it or not, I had apparently had Deja-vu of myself editing this message. Creepy huh?
 
Last edited:

reddvilzz

New Member
Jul 29, 2019
376
0
1
@Eyamaz, i was wondering if I pump out the permGen into 512 or 1024 instead of 256 will it helps? or will it better to make it stay at 256?
 

keybounce

New Member
Jul 29, 2019
1,925
0
0
For the "Occasional stutter but noticeable" issue, and garbage collection logs:

Add the following flags to your launcher:

-XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+PrintGCDetails -Xloggc:GC.log

This will put all the details of garbage collection into "GC.log", which can then be uploaded. If you can note the computer clock (including seconds!!) when the pauses happen, this will help see if the pauses correspond to garbage collection incidents.

If you record your screen while playing, then "What's My Light Level" has a parameter to put the localtime on-screen; this lets you accurately match the times of visible stutter to garbage collection activity or lack of activity.[DOUBLEPOST=1388288880][/DOUBLEPOST]
@Eyamaz, i was wondering if I pump out the permGen into 512 or 1024 instead of 256 will it helps? or will it better to make it stay at 256?

Setting permgen higher than it needs to be has no positive effect. And, since it takes memory away from the rest of the heap, in 32 bit java it has a negative effect.

If you use "-XX:MaxPermSize=500m", then Java will resize the memory as needed, only allocating as much as is needed, and not harming the rest of the heap.

Remember, there is nothing special about powers of 2 for these memory settings.
 
  • Like
Reactions: reddvilzz

Eyamaz

New Member
Jul 29, 2019
2,373
0
0
Well, before the next Monster update, I should be updating the OP again. Going to be dropping tiered comp till I decide whether or not keeping it is going to remain worth it. In fact, a number of things are going to be removed to something a bit more basic concentrating on Heap and GC mostly.
 

reddvilzz

New Member
Jul 29, 2019
376
0
1
For the "Occasional stutter but noticeable" issue, and garbage collection logs:

Setting permgen higher than it needs to be has no positive effect. And, since it takes memory away from the rest of the heap, in 32 bit java it has a negative effect.

If you use "-XX:MaxPermSize=500m", then Java will resize the memory as needed, only allocating as much as is needed, and not harming the rest of the heap.

Remember, there is nothing special about powers of 2 for these memory settings.

so 256 is the best value or can I use 512 for the best value? since there is no point setting it bigger than 512 as far as i know right?
 

kj.

New Member
Jul 29, 2019
14
0
0
Um, something went wrong here.
This is the code I use to run the server:
-Xms2048m -Xmx2048m -XX:permSize=256m -XX:ReservedCodeCacheSize=512m -XX:NewRatio=4 -XX:SurvivorRatio=3 -XX:TargetSurvivorRatio=80 -XX:MaxTenuringThreshold=8 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=0 -XX:MaxGCPauseMillis=20 -XX:GCPauseIntervalMillis=250 -XX:MaxGCMinorPauseMillis=7 -XX:+CMSClassUnloadingEnabled -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=50 -XX:+BindGCTaskThreadsToCPUs -XX:+TieredCompilation -XX:Tier0ProfilingStartPercentage=0 -XX:Tier3InvocationThreshold=3 -XX:Tier3MinInvocationThreshold=2 -XX:Tier3CompileThreshold=2 -XX:Tier3BackEdgeThreshold=10 -XX:Tier4InvocationThreshold=4 -XX:Tier4MinInvocationThreshold=3 -XX:Tier4CompileThreshold=2 -XX:Tier4BackEdgeThreshold=8 -XX:TieredCompileTaskTimeout=5000 -XX:Tier3DelayOn=50 -XX:Tier3DelayOff=25 -XX:+UseFastEmptyMethods -XX:-DontCompileHugeMethods -XX:+AlwaysCompileLoopMethods -XX:+CICompilerCountPerCPU -XX:+UseStringCache -XX:+UseNUMA
After that I saved it as a .bat file.
(if you are wondering the GMAM stands for Galactic Machiens and Magic and it is a modpack me and a friend is making, we made this server to test it)

The code has no enter's, tab's or anything like that, it goes in a straight line like this: ( I added the pause to check the error [it just closed on itself when I ran it])

RSCt7DR.png


And this is the "error":
YnTEyBZ.png


I use a 1.6.4 server with ~150 mods.
Java version: "Version 7 Update 45"
No plugins whatsoever, just modded with mods.


EDIT: I fixed it. This is my code:
java -Xms2048m -Xmx2048m -XX:permSize=256m -XX:ReservedCodeCacheSize=512m -XX:NewRatio=4 -XX:SurvivorRatio=3 -XX:TargetSurvivorRatio=80 -XX:MaxTenuringThreshold=8 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=0 -XX:MaxGCPauseMillis=20 -XX:GCPauseIntervalMillis=250 -XX:MaxGCMinorPauseMillis=7 -XX:+CMSClassUnloadingEnabled -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=50 -XX:+BindGCTaskThreadsToCPUs -XX:+TieredCompilation -XX:Tier0ProfilingStartPercentage=0 -XX:Tier3InvocationThreshold=3 -XX:Tier3MinInvocationThreshold=2 -XX:Tier3CompileThreshold=2 -XX:Tier3BackEdgeThreshold=10 -XX:Tier4InvocationThreshold=4 -XX:Tier4MinInvocationThreshold=3 -XX:Tier4CompileThreshold=2 -XX:Tier4BackEdgeThreshold=8 -XX:TieredCompileTaskTimeout=5000 -XX:Tier3DelayOn=50 -XX:Tier3DelayOff=25 -XX:+UseFastEmptyMethods -XX:-DontCompileHugeMethods -XX:+AlwaysCompileLoopMethods -XX:+CICompilerCountPerCPU -XX:+UseStringCache -XX:+UseNUMA -jar minecraft_server.1.6.4.jar gui
pause


EDIT2: Now I got a new error...
[SEVERE] Encountered an unexpected exception LoaderException
cpw.mods.fml.common.LoaderException: java.lang.OutOfMemoryError: Java heap space
at cpw.mods.fml.common.LoadController.transition(LoadController.java:156)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:523)
at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:99)
at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:350)
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:69)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445)
at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:583)
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Unknown Source)
at java.lang.String.<init>(Unknown Source)
at java.util.zip.ZipCoder.toString(Unknown Source)
at java.util.zip.ZipFile.getZipEntry(Unknown Source)
at java.util.zip.ZipFile.access$900(Unknown Source)
at java.util.zip.ZipFile$1.nextElement(Unknown Source)
at java.util.zip.ZipFile$1.nextElement(Unknown Source)
at java.util.jar.JarFile$1.nextElement(Unknown Source)
at java.util.jar.JarFile$1.nextElement(Unknown Source)
at com.google.common.reflect.ClassPath.browseJar(ClassPath.java:317)
at com.google.common.reflect.ClassPath.browseFrom(ClassPath.java:278)
at com.google.common.reflect.ClassPath.browse(ClassPath.java:265)
at com.google.common.reflect.ClassPath.browseJar(ClassPath.java:313)
at com.google.common.reflect.ClassPath.browseFrom(ClassPath.java:278)
at com.google.common.reflect.ClassPath.browse(ClassPath.java:265)
at com.google.common.reflect.ClassPath.browseJar(ClassPath.java:313)
at com.google.common.reflect.ClassPath.browseFrom(ClassPath.java:278)
at com.google.common.reflect.ClassPath.browse(ClassPath.java:265)
at com.google.common.reflect.ClassPath.browseJar(ClassPath.java:313)
at com.google.common.reflect.ClassPath.browseFrom(ClassPath.java:278)
at com.google.common.reflect.ClassPath.browse(ClassPath.java:265)
at com.google.common.reflect.ClassPath.browseJar(ClassPath.java:313)
at com.google.common.reflect.ClassPath.browseFrom(ClassPath.java:278)
at com.google.common.reflect.ClassPath.browse(ClassPath.java:265)
at com.google.common.reflect.ClassPath.browseJar(ClassPath.java:313)
at com.google.common.reflect.ClassPath.browseFrom(ClassPath.java:278)
at com.google.common.reflect.ClassPath.browse(ClassPath.java:265)
at com.google.common.reflect.ClassPath.browseJar(ClassPath.java:313)
at com.google.common.reflect.ClassPath.browseFrom(ClassPath.java:278)
at com.google.common.reflect.ClassPath.browse(ClassPath.java:265)
at com.google.common.reflect.ClassPath.browseJar(ClassPath.java:313)
at com.google.common.reflect.ClassPath.browseFrom(ClassPath.java:278)


Do I just need more RAM allocated ?(Java newbie)
 
Last edited:

keybounce

New Member
Jul 29, 2019
1,925
0
0
so 256 is the best value or can I use 512 for the best value? since there is no point setting it bigger than 512 as far as i know right?
There is no upper limit imposed by java, other than the total size of the heap.

As long as you only specify the max size, and are OK with java doing a full GC every time it wants to resize it, there is no problem with setting the max size very large.

If you want to try to predict the largest possible mod pack, and set the max size for that, and assume that no one will ever make a bigger mod pack, go right ahead. I won't, and I won't say "X is the largest you need".

Right now, I've never heard of anyone running out of perm space at 256. Doesn't mean it doesn't happen. Just that I haven't heard of it. And, in case it does, I gave 500 as an example. I personally use 150 (I'm working with a modpack that is 100 right now.)[DOUBLEPOST=1388338070][/DOUBLEPOST]
EDIT2: Now I got a new error...
[SEVERE] Encountered an unexpected exception LoaderException
cpw.mods.fml.common.LoaderException: java.lang.OutOfMemoryError: Java heap space
at cpw.mods.fml.common.LoadController.transition(LoadController.java:156)
...

Do I just need more RAM allocated ?(Java newbie)

Please avoid using special text. Part of your post was in small fonts and hard to read.

You are running out of memory, and need more allocated. But your launch flags are specifying 2 gig. So, check elsewhere.

On your java control panel, do you have any flags set? I believe that any flags set there will override anything you try to use to run minecraft, and if you have memory settings there, then you are bleeped.
 

kj.

New Member
Jul 29, 2019
14
0
0
There is no upper limit imposed by java, other than the total size of the heap.

As long as you only specify the max size, and are OK with java doing a full GC every time it wants to resize it, there is no problem with setting the max size very large.

If you want to try to predict the largest possible mod pack, and set the max size for that, and assume that no one will ever make a bigger mod pack, go right ahead. I won't, and I won't say "X is the largest you need".

Right now, I've never heard of anyone running out of perm space at 256. Doesn't mean it doesn't happen. Just that I haven't heard of it. And, in case it does, I gave 500 as an example. I personally use 150 (I'm working with a modpack that is 100 right now.)[DOUBLEPOST=1388338070][/DOUBLEPOST]

Please avoid using special text. Part of your post was in small fonts and hard to read.

You are running out of memory, and need more allocated. But your launch flags are specifying 2 gig. So, check elsewhere.

On your java control panel, do you have any flags set? I believe that any flags set there will override anything you try to use to run minecraft, and if you have memory settings there, then you are bleeped.
I dont know wtf a java control panel is, so I can't possibly have set a "flag" there...
 

Eyamaz

New Member
Jul 29, 2019
2,373
0
0
Updated OP. Going back to basics during the time of profiling monster. still looking at some issues that may be solved with other arguments. for now, all compilation flags are being removed because of some issues ive found in Monster that causes some hell of lag if a loop or huge method is transitioned from t3(c1 compile) to full t4(c2 optimized) compilation.
 
  • Like
Reactions: lavarthan

Yusunoha

New Member
Jul 29, 2019
6,440
-4
0
hmm, I used the old JVM code for the FTB launcher in the vanilla launcher without a problem, but if I now use the new JVM code for the FTB launcher for the vanilla launcher I crash with this code

Code:
[11:10:59 INFO]: Client> 2013-12-31 11:10:58 [SEVERE] [ForgeModLoader] The following problems were captured during this phase
[11:11:03 INFO]: Client> 2013-12-31 11:11:03 [INFO] [STDERR] Exception in thread "Minecraft main thread" java.lang.OutOfMemoryError: PermGen space
[11:11:06 ERROR]: Game ended with bad state (exit code 1)
[11:11:06 INFO]: Deleting .minecraft\versions\1.6.4-Forge9.11.1.965\1.6.4-Forge9.11.1.965-natives-6382925887407
[11:11:06 INFO]: Ignoring visibility rule and showing launcher due to a game crash

it's not that much of a problem, as I can just keep using the old code. but I just thought of posting this code here just in case it might be of any use
 

boclfon479

New Member
Jul 29, 2019
16
0
0
you guys are literally amazing!

I have been having trouble running my server on my computer and playing on a laptop, and it would lag crazily when there was only 1-2 people on the server if ANYTHING was happening on my computer, but now that i put these settings on it does not, and i wanted to thank you guys for giving us the information, you guys are amazing!!


ALSO, in the FTB launcher and Server settings ones, you have Xms set to 2048m, but i had to change the m to a capital M in order to get it to work, in case anyone else is having a problem with it registering megabytes
 

AforAnonymous

New Member
Jul 29, 2019
62
0
0
hmm, I used the old JVM code for the FTB launcher in the vanilla launcher without a problem, but if I now use the new JVM code for the FTB launcher for the vanilla launcher I crash with this code

Code:
[11:10:59 INFO]: Client> 2013-12-31 11:10:58 [SEVERE] [ForgeModLoader] The following problems were captured during this phase
[11:11:03 INFO]: Client> 2013-12-31 11:11:03 [INFO] [STDERR] Exception in thread "Minecraft main thread" java.lang.OutOfMemoryError: PermGen space
[11:11:06 ERROR]: Game ended with bad state (exit code 1)
[11:11:06 INFO]: Deleting .minecraft\versions\1.6.4-Forge9.11.1.965\1.6.4-Forge9.11.1.965-natives-6382925887407
[11:11:06 INFO]: Ignoring visibility rule and showing launcher due to a game crash

it's not that much of a problem, as I can just keep using the old code. but I just thought of posting this code here just in case it might be of any use
It's probably permgen. Try setting the permgen parameter.