How to increase max memory?
-
This should likely get the same fix as the Metabase package did to make the JVM limits better reflect the available resources.
Context: https://forum.cloudron.io/topic/3588/frequent-java-lang-outofmemoryerror-java-heap-space-errors/5?_=1612137576983
Fix (for Metabase): https://git.cloudron.io/cloudron/metabase-app/-/blob/master/start.sh#L38-42cc @girish
-
@jimcavoli yeah. I didn’t realize this was done for meta base. I was actually working on that in my forked repo for forge minecraft
-
@rossmaclean Funny I worked on my custom paper mc minecraft app last weekend and can agree this does not get dynamically updated.
https://git.cloudron.io/BrutalBirdie/papermc-minecraft-app/-/tree/feature/v1.6.5Here with the line you mentioned:
https://git.cloudron.io/BrutalBirdie/papermc-minecraft-app/-/blob/feature/v1.6.5/backend/minecraft.js#L28
(Custom app with paper mc instead of vanilla since I want some plugins )Also I am not 100% sure if it needs to be updated at all.
I also followed the Tuning the JVM – G1GC Garbage Collector Flags for Minecraft guide from the creator of PaperMC (but scrapped the
-XX:+AlwaysPreTouch
due to crashing.)Also noting that with Minecraft 1.17 release the
openjdk-8-jdk-headless
need to upgraded toopenjdk-11-jdk-headless
which I tried and ended up with a non working app, so I switched back toopenjdk-8-jdk-headless
-
I've tried to fixup the app to dynamically adjust the java memory: https://git.cloudron.io/cloudron/minecraft-app/-/commit/1d86c23c59c04d343bd35c112722b22fb33c9e6d
I also uploaded a version to test this with https://my.<domain.com>/#/appstore/net.minecraft.cloudronapp?version=1.3.7
Would be good to get feedback if this is the fix you expected, then I can make a package release.
-
Thanks everyone for your replies and suggestions.
@nebulon I've deployed that version and it looks good to me. Thanks for your work! I'll keep an eye on the server once the package is released and if the server crashes again I'll be able to see in the crash report how much memory it was using at the time.
-
@nebulon said in How to increase max memory?:
I've tried to fixup the app to dynamically adjust the java memory: https://git.cloudron.io/cloudron/minecraft-app/-/commit/1d86c23c59c04d343bd35c112722b22fb33c9e6d
I also uploaded a version to test this with https://my.<domain.com>/#/appstore/net.minecraft.cloudronapp?version=1.3.7
Would be good to get feedback if this is the fix you expected, then I can make a package release.
Hmm
When setting the App to 10G Memory with cloudron I get thisFeb 02 22:50:38 start minecraft server with memory limit 5120 M
Which is kinda correct since
Cloudron allocates 50% of this value as RAM and 50% as swap.
But still feels a bit misleading.
-
@brutalbirdie said in How to increase max memory?:
Cloudron allocates 50% of this value as RAM and 50% as swap.
In 6.1, we have changed this strategy. Cloudron now allocates the % based on the system's proportion of RAM and Swap. We found that when a server has lots of memory, it was still busy swapping because we always allocated 50-50.
-
@robi said in How to increase max memory?:
@girish How does this affect running apps of an upgraded system?
Only newly installed apps get the new allocation %. Existing apps run with 50% as before. If you want to change it, you can just adjust the memory of the app a bit and it will reallocate with new strategy.