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. App Packaging & Development
  3. memory_limit on Cloudron Manifest in bytes and how Cloudron UI shows it / converts it

memory_limit on Cloudron Manifest in bytes and how Cloudron UI shows it / converts it

Scheduled Pinned Locked Moved App Packaging & Development
5 Posts 2 Posters 854 Views 2 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.
  • d19dotcaD Offline
    d19dotcaD Offline
    d19dotca
    wrote on last edited by d19dotca
    #1

    I'm probably overthinking this and math is not my strong suit so please forgive me. I'm posting this for two reasons: 1) To learn how this works for custom packages, and 2) To see if there's a bug or anything in the other packages I was using to compare with and how Cloudron UI displays them.

    I was trying to look at some of my apps and noticed an odd behaviour, and this made me dig into the memory_limit set in the app packages, which made me wonder how these numbers are arrived at / displayed in the UI.

    I noticed in nodeBB it has a value of 1000 MB as the memory limit instead of showing 1 GB as other apps do once you hit the 1 GB max memory on the Resources tab. This lead me to look at how the package was built, and I was expecting to see the value in bytes as 1000000000 bytes, but instead I see 1048576000.

    How did 1048576000 come to be, how was that number arrived at?

    I feel like I'm missing something obvious here, and math is not my strong suit so I'm sure I am missing something haha. I guess this comes down to if we're converting in decimal or binary? But even in binary, if I did the math right (likely didn't, lol), the bytes should then be 1073741824, right? Perhaps that's why the Cloudron UI is showing 1000 MB instead of 1 GB?

    If so, can I fix it in the Git package so I feel like I fixed something? 😛 hahaha

    Otherwise please explain the math to me so I can understand when trying to set the appropriate value in a custom package that I may look to making soon. Thanks in advance. 🙂

    --
    Dustin Dauncey
    www.d19.ca

    1 Reply Last reply
    0
    • d19dotcaD Offline
      d19dotcaD Offline
      d19dotca
      wrote on last edited by
      #2

      Here's what NodeBB shows btw for 1 GB (note: 1000 MB)
      02f77f4b-f9b4-4dd7-b914-b6afcb306422-image.png

      Here's what another app like Gitea shows for 1 GB:
      6a1cec1c-d150-4a53-9996-2427f33ecad8-image.png

      --
      Dustin Dauncey
      www.d19.ca

      mehdiM 1 Reply Last reply
      0
      • d19dotcaD Offline
        d19dotcaD Offline
        d19dotca
        wrote on last edited by
        #3

        a52e2721-d37e-4206-ae02-d23f1420866e-image.png

        --
        Dustin Dauncey
        www.d19.ca

        1 Reply Last reply
        0
        • d19dotcaD d19dotca

          Here's what NodeBB shows btw for 1 GB (note: 1000 MB)
          02f77f4b-f9b4-4dd7-b914-b6afcb306422-image.png

          Here's what another app like Gitea shows for 1 GB:
          6a1cec1c-d150-4a53-9996-2427f33ecad8-image.png

          mehdiM Offline
          mehdiM Offline
          mehdi
          App Dev
          wrote on last edited by
          #4

          @d19dotca it's because of https://git.cloudron.io/cloudron/nodebb-app/-/blob/master/CloudronManifest.json#L24

          This value, 1048576000, is actually equal to 1024 * 1024 * 1000, so it really does use 1000MB, not 1024, hence not 1GB (using binary units)

          d19dotcaD 1 Reply Last reply
          2
          • mehdiM mehdi

            @d19dotca it's because of https://git.cloudron.io/cloudron/nodebb-app/-/blob/master/CloudronManifest.json#L24

            This value, 1048576000, is actually equal to 1024 * 1024 * 1000, so it really does use 1000MB, not 1024, hence not 1GB (using binary units)

            d19dotcaD Offline
            d19dotcaD Offline
            d19dotca
            wrote on last edited by d19dotca
            #5

            @mehdi Yes I saw that part, that's where I got the 1048576000 from and it got me digging into it further. I guess then the display is using binary in Cloudron UI so the value it's set to isn't quite 1 GB in binary so it shows 1000 MB. Interesting. That seems wrong to me though, I assume the value in that manifest should actually be 1073741824 to match others that are 1 GB. Right?

            Example: 1073741824 is what's set for Bitwarden: https://git.cloudron.io/cloudron/bitwardenrs-app/-/blob/master/CloudronManifest.json#L17

            Am I right in assuming then from this that the Cloudron UI basically shows in Decimal, and not Binary? But ideally the Manifest should be in Binary still so the UI shows the more expected typical numbers and increase segments, right?

            --
            Dustin Dauncey
            www.d19.ca

            1 Reply Last reply
            0
            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