Voxelum / minecraft-launcher-core-node

Provide packages to install Minecraft, launch Minecraft and more to build launcher with NodeJs/Electron!
https://docs.xmcl.app/en/core/
MIT License
174 stars 25 forks source link

Problem with the allocated memory #217

Closed Burstyx closed 2 years ago

Burstyx commented 2 years ago

I have a problem when I want to allocate memories to Minecraft. Here's the launch function : image On the maxMemory property i give 4096M of ram but when the game launch only 2048M are allocated to Minecraft. image Thanks for the help

ci010 commented 2 years ago

I think you should use the minMemory to set the minimum memory for java. Notice that the minMemory and the maxMemory are adding argument -Xmx and -Xms to jvm arguments. The actual behavior is decided by JVM.

Burstyx commented 2 years ago

I think you should use the minMemory to set the minimum memory for java. Notice that the minMemory and the maxMemory are adding argument -Xmx and -Xms to jvm arguments. The actual behavior is decided by JVM.

I set the minimum memory for java and i have the same issue

jamesonknutson commented 2 years ago

pull req #222 should fix this

tiltysola commented 2 years ago

I have the same issue

my spawn args

[
'-Xmx16384M',
'-Dauthlibinjector.side=client',
'-XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump',
'-Dos.name=Windows 10',
'-Dos.version=10.0',
'-Djava.library.path=C:\\Users\\fanta\\AppData\\Roaming\\project-paradise-client\\.minecraft\\versions\\1.17.1-fabric\\1.17.1-fabric-natives',
'-Dminecraft.launcher.brand=Launcher',
'-Dminecraft.launcher.version=0.0.1',
'-Xmn128m',
'-Xmx4096m',
'-Xms4096m',
'-XX:+UnlockExperimentalVMOptions',
'-XX:+UseG1GC',
'-XX:G1NewSizePercent=20',
'-XX:G1ReservePercent=20',
'-XX:MaxGCPauseMillis=50',
'-XX:G1HeapRegionSize=16M',
'-XX:-UseAdaptiveSizePolicy',
'-XX:-OmitStackTraceInFastThrow',
'--illegal-access=permit',
'-Dfml.ignoreInvalidMinecraftCertificates=true',
'-Dfml.ignorePatchDiscrepancies=true',
'net.fabricmc.loader.launch.knot.KnotClient',
'--username',
'魂魄妖梦',
'--version',
'1.17.1-fabric',
'--gameDir',
'C:\\Users\\fanta\\AppData\\Roaming\\project-paradise-client\\.minecraft',
'--assetsDir',
'C:\\Users\\fanta\\AppData\\Roaming\\project-paradise-client\\.minecraft\\assets',
'--assetIndex',
'1.17',
'--userType',
'Mojang',
'--versionType',
'release',
'--height',
'1080',
'--width',
'1920'
]

And I even set -Xmx16384M, it only alloc about 2500M. Which cause my shaders crash

ci010 commented 2 years ago

This should be fixed in #223.