Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved How to increase max memory?

    Minecraft
    7
    13
    594
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rossmaclean last edited by

      Hi,

      It appears that the max memory flag is hardcoded here:
      https://git.cloudron.io/cloudron/minecraft-app/-/blob/master/backend/minecraft.js#L28

      I am seeing frequent crashes and I think it may be due to max memory being capped at 1GB. How can I overcome this?

      Cheers,

      Ross

      ? BrutalBirdie 2 Replies Last reply Reply Quote 0
      • ?
        A Former User @rossmaclean last edited by

        @rossmaclean Weird. I feel like I've seen mine exceed 1GB but I'll monitor it next time there is activity on the server and let you know what I find.

        1 Reply Last reply Reply Quote 0
        • jimcavoli
          jimcavoli App Dev last edited by

          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-42

          cc @girish

          ? 1 Reply Last reply Reply Quote 0
          • ?
            A Former User @jimcavoli last edited by

            @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

            1 Reply Last reply Reply Quote 0
            • BrutalBirdie
              BrutalBirdie Staff @rossmaclean last edited by BrutalBirdie

              @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.5

              Here 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 to openjdk-11-jdk-headless which I tried and ended up with a non working app, so I switched back to openjdk-8-jdk-headless

              Like my work? Consider donating a beer 🍻 Cheers!

              1 Reply Last reply Reply Quote 0
              • nebulon
                nebulon Staff last edited by

                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.

                R BrutalBirdie 2 Replies Last reply Reply Quote 1
                • R
                  rossmaclean @nebulon last edited by

                  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.

                  1 Reply Last reply Reply Quote 1
                  • BrutalBirdie
                    BrutalBirdie Staff @nebulon last edited by

                    @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 this

                    Feb 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.

                    Like my work? Consider donating a beer 🍻 Cheers!

                    girish 1 Reply Last reply Reply Quote 0
                    • girish
                      girish Staff @BrutalBirdie last edited by

                      @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 BrutalBirdie 2 Replies Last reply Reply Quote 0
                      • robi
                        robi @girish last edited by

                        @girish How does this affect running apps of an upgraded system?

                        Is there a new default?

                        Life of Advanced Technology

                        girish 1 Reply Last reply Reply Quote 0
                        • BrutalBirdie
                          BrutalBirdie Staff @girish last edited by

                          @girish hmmm good to know. I will update and check it again.

                          Like my work? Consider donating a beer 🍻 Cheers!

                          1 Reply Last reply Reply Quote 0
                          • girish
                            girish Staff @robi last edited by

                            @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.

                            robi 1 Reply Last reply Reply Quote 1
                            • robi
                              robi @girish last edited by

                              @girish how do we mass adjust 50+ apps? 😉

                              Life of Advanced Technology

                              1 Reply Last reply Reply Quote 1
                              • First post
                                Last post
                              Powered by NodeBB