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 leak when custom image is deployed in cloudron

Memory leak when custom image is deployed in cloudron

Scheduled Pinned Locked Moved Solved App Packaging & Development
6 Posts 3 Posters 881 Views 3 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.
  • ruihildtR Offline
    ruihildtR Offline
    ruihildt
    wrote on last edited by ruihildt
    #1

    My issue is that I have a website which is a SvelteKit SSR app (Node based), locally the memory usage is stable, but when I deploy it on cloudron, it keeps climbing until it reaches the limit.

    In the image below, you can see the memory balloons until it reaches the limit. (for the last test, I changed the limit from 256MB to 512MB)

    56a4382e-ace5-44bc-b1c2-833237552cd6-image.png

    I tried running the docker container locally, and the memory footprint (using docker stats ) is stable at 116MB.

    What can I do to fix this memory leak?

    1 Reply Last reply
    0
    • fbartelsF Offline
      fbartelsF Offline
      fbartels
      App Dev
      wrote on last edited by
      #2

      Hi @ruihildt,

      I haven't worked with sveltekit yet, but if you see the leak on Cloudron but not locally when using the same container, then I would think it must have to do with incoming requests. is it perhaps the healthcheck that generates this memory?

      1 Reply Last reply
      0
      • girishG Do not disturb
        girishG Do not disturb
        girish
        Staff
        wrote on last edited by
        #3

        Ah great point, about the healthchecks! These are invoked every 10 seconds btw.

        1 Reply Last reply
        0
        • girishG girish moved this topic from Support on
        • ruihildtR Offline
          ruihildtR Offline
          ruihildt
          wrote on last edited by
          #4

          How could I test that assumption?

          1 Reply Last reply
          0
          • fbartelsF Offline
            fbartelsF Offline
            fbartels
            App Dev
            wrote on last edited by
            #5

            that could be as simple as:

            while true; do curl 127.0.0.1:8080/health; sleep 10; done

            But with the correct ip/port and the expected health endpoint.

            1 Reply Last reply
            3
            • ruihildtR Offline
              ruihildtR Offline
              ruihildt
              wrote on last edited by
              #6

              So the memory leak indeed seemed to be coming from the frequent health check.
              I customized the health check path and returned a simple response object, and it seems to do the trick.

              image.png

              I still think I have something incorrectly handled somewhere and if the website would have a lot of traffic, the issue would probably resurface.

              But it's not very likely, so I'll stick to YAGNI. (I'll keep an eye on the stats in any case.)

              Thanks for the help.

              1 Reply Last reply
              2
              • ruihildtR ruihildt marked this topic as a question on
              • ruihildtR ruihildt has marked this topic as solved on
              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