Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid maximum heap size #589

Open
mayconvs opened this issue Nov 22, 2023 · 7 comments
Open

Invalid maximum heap size #589

mayconvs opened this issue Nov 22, 2023 · 7 comments

Comments

@mayconvs
Copy link

Hello,
I'm having the following error when running the run.bat that I created inside the server folder with the following command lines copied from your wiki :

java -Xmx8G -Xms8G -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=0 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -XX:+ UseG1GC -jar forge-1.16.5-36.2.8.jar nogui
pause

After executing this file, the following message appears in cmd:

E:\Above+and+Beyond-1.3-Server>java -Xmx8G -Xms8G -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=0 -XX:G1ReservePercent=20 -XX: MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -XX:+UseG1GC -jar forge-1.16.5-36.2.20.jar nogui
Invalid maximum heap size: -Xmx8G
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

If I try to open "forge-1.16.5-36.2.20.jar" it doesn't work. Nothing happens.

I already tried reducing "-Xmx8G -Xms8G" to "-Xmx4G -Xms4G" and it gave the same error...

When I download the server files folder in curseforge it already comes with "forge-1.16.5-36.2.20-installer.jar", so, apparently, the server folder itself that is in curseforge installs forge version 1.16.5-36.2.20. Should I install forge version 1.16.5-36.2.8?

My settings:

Windows 11
JAVA 8
forge-1.16.5-36.2.20
16GB RAM

@mayconvs
Copy link
Author

mayconvs commented Nov 22, 2023

I tried with "-Xmx1G -Xms1G" and it seems like it was, however, it gave another error:

E:\Above+and+Beyond-1.3-Server>java -Xmx1G -Xms1G -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=0 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -XX:+UseG1GC -jar E:\Above+and+Beyond-1.3-Server\forge-1.16.5-36.2.20.jar nogui
2023-11-22 18:39:25,548 main WARN Advanced terminal features are not available in this environment
[18:39:25] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmlserver, --fml.forgeVersion, 36.2.20, --fml.mcpVersion, 20210115.111550, --fml.mcVersion, 1.16.5, --fml.forgeGroup, net.minecraftforge, nogui]
[18:39:25] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 8.0.9+86+master.3cf110c starting: java version 1.8.0_391 by Oracle Corporation
[18:39:26] [main/INFO] [ne.mi.fm.lo.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust
[18:39:26] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.4 Source=file:/E:/Above+and+Beyond-1.3-Server/libraries/org/spongepowered/mixin/0.8.4/mixin-0.8.4.jar Service=ModLauncher Env=SERVER
[18:39:28] [main/ERROR] [mixin/]: Mixin config antiqueatlas.mixins.json does not specify "minVersion" property
Exception in thread "main" [18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]: java.lang.NoSuchMethodError: sun.security.util.ManifestEntryVerifier.<init>(Ljava/util/jar/Manifest;)V
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.SecureJarHandler.createCodeSource(SecureJarHandler.java:66)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:275)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:136)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at java.lang.ClassLoader.loadClass(Unknown Source)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at java.lang.Class.forName0(Native Method)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at java.lang.Class.forName(Unknown Source)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at org.spongepowered.asm.service.modlauncher.ModLauncherClassProvider.findClass(ModLauncherClassProvider.java:67)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at org.spongepowered.asm.launch.platform.MixinConnectorManager.loadConnectors(MixinConnectorManager.java:70)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at org.spongepowered.asm.launch.platform.MixinConnectorManager.inject(MixinConnectorManager.java:59)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at org.spongepowered.asm.launch.platform.MixinPlatformManager.inject(MixinPlatformManager.java:196)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at org.spongepowered.asm.launch.MixinBootstrap.inject(MixinBootstrap.java:202)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at org.spongepowered.asm.launch.MixinLaunchPluginLegacy.initializeLaunch(MixinLaunchPluginLegacy.java:201)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at org.spongepowered.asm.launch.MixinLaunchPluginLegacy.initializeLaunch(MixinLaunchPluginLegacy.java:195)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.LaunchPluginHandler.lambda$announceLaunch$9(LaunchPluginHandler.java:97)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at java.util.HashMap.forEach(Unknown Source)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.LaunchPluginHandler.announceLaunch(LaunchPluginHandler.java:97)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:52)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.Launcher.run(Launcher.java:82)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.Launcher.main(Launcher.java:66)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at net.minecraftforge.server.ServerMain$Runner.runLauncher(ServerMain.java:63)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at net.minecraftforge.server.ServerMain$Runner.access$100(ServerMain.java:60)
[18:39:28] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at net.minecraftforge.server.ServerMain.main(ServerMain.java:57)

@mayconvs
Copy link
Author

I installed java 1.8.0_311 and forge-1.16.5-36.2.26 (only in the server folder) and it seems to have worked.... I'm playing with my friend like this. I believe that if you install just forge-1.16.5-36.2.26 it might work well... You have to test it...

@glektarssza
Copy link

glektarssza commented Dec 12, 2023

Can you post the output of running java -version?

I suspect you're running a 32-bit version of Java which does not support heap sizes above 4 GB. The default downloader on the Java website is 32-bit.

@glektarssza
Copy link

The other issue you ran into is probably related to #434, looks like a Java/Forge compatibility issue.

@mayconvs
Copy link
Author

@glektarssza Yes!

java version "1.8.0_311"
Java(TM) SE Runtime Environment (build 1.8.0_311-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.311-b11, mixed mode)

@glektarssza
Copy link

Okay, you've got a 64-bit version of Java. That's good. I'll check my configuration once I'm off work in about 1.5 hours. I know I'm running with 8 GB of RAM allocated to Minecraft but I did need to update my version of Forge and Java. I'm using the latest of each, so latest Forge for 1.16.5 and the latest Java 8 JRE. Version numbers will be posted shortly.

@glektarssza
Copy link

Alrighty. I'm using:

  • Java 1.8.0_392 (from Temurin)
  • Minecraft 1.16.5
  • Forge 36.2.39
  • LWJGL 3.2.2

JVM Arguments:

-XX:+UseG1GC -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M --add-opens=java.base/sun.security.util=ALL-UNNAMED --add-opens=java.base/java.util.jar=ALL-UNNAMED -XX:+IgnoreUnrecognizedVMOptions -Xmx8G -Xms8G

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants