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


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Minecraft
  3. How to increase max memory?

How to increase max memory?

Scheduled Pinned Locked Moved Solved Minecraft
13 Posts 7 Posters 2.7k Views 7 Watching
  • 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.
  • jimcavoliJ jimcavoli

    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

    ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #4

    @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
    0
    • R rossmaclean

      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

      BrutalBirdieB Offline
      BrutalBirdieB Offline
      BrutalBirdie
      Partner
      wrote on last edited by BrutalBirdie
      #5

      @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 drink. Cheers!

      1 Reply Last reply
      0
      • nebulonN Away
        nebulonN Away
        nebulon
        Staff
        wrote on last edited by
        #6

        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 BrutalBirdieB 2 Replies Last reply
        1
        • nebulonN nebulon

          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 Offline
          R Offline
          rossmaclean
          wrote on last edited by
          #7

          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
          1
          • nebulonN nebulon

            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.

            BrutalBirdieB Offline
            BrutalBirdieB Offline
            BrutalBirdie
            Partner
            wrote on last edited by
            #8

            @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 drink. Cheers!

            girishG 1 Reply Last reply
            0
            • BrutalBirdieB BrutalBirdie

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

              girishG Offline
              girishG Offline
              girish
              Staff
              wrote on last edited by
              #9

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

              robiR BrutalBirdieB 2 Replies Last reply
              0
              • girishG girish

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

                robiR Offline
                robiR Offline
                robi
                wrote on last edited by
                #10

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

                Is there a new default?

                Conscious tech

                girishG 1 Reply Last reply
                0
                • girishG girish

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

                  BrutalBirdieB Offline
                  BrutalBirdieB Offline
                  BrutalBirdie
                  Partner
                  wrote on last edited by
                  #11

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

                  Like my work? Consider donating a drink. Cheers!

                  1 Reply Last reply
                  0
                  • robiR robi

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

                    Is there a new default?

                    girishG Offline
                    girishG Offline
                    girish
                    Staff
                    wrote on last edited by
                    #12

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

                    robiR 1 Reply Last reply
                    1
                    • girishG girish

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

                      robiR Offline
                      robiR Offline
                      robi
                      wrote on last edited by
                      #13

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

                      Conscious tech

                      1 Reply Last reply
                      1
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Bookmarks
                      • Search