Memory Leak Issue

Hi,

I am using my CoreOS just to run single container of unifi cloud controller. But I think there is a problem with my installation because the memory usage will raised over time until the server become unresponsive at all. Here is the screenshot of top memory usage:

Any idea why there is java & mongod service in my installation? I am only running this command to install docker-compose after initiating my server:

sudo rpm-ostree install docker-compose

And here is my docker-compose file content:

---
version: "2.1"
services:
  unifi-controller:
    image: linuxserver/unifi-controller
    container_name: unifi-controller
    privileged: true
    environment:
      - PUID=1000
      - PGID=1000
      - MEM_LIMIT=1024M #optional
    volumes:
      - /var/home/core/volumes/unifi-config:/config
    ports:
      - 3478:3478/udp
      - 10001:10001/udp
      - 8080:8080
      - 443:8443
      - 1900:1900/udp #optional
      - 8843:8843 #optional
      - 8880:8880 #optional
      - 6789:6789 #optional
      - 5514:5514 #optional
    restart: unless-stopped

And finally here is the content of my ignition file:

variant: fcos
version: 1.0.0
passwd:
  users:
    - name: core
      ssh_authorized_keys:
        - "ssh-ed25519 AAAA**********"
      groups: [ sudo, docker ]
storage:
  files:
    - path: /etc/hostname
      overwrite: true
      contents:
        inline: unifi

Both are most likely part of the container you are running as they are not installed in Fedora CoreOS by default. Looks like you have a memory leak issue within one of application that is being ran as part of the container. You can try to set memory limits with podman to avoid making your server unresponsive but that will might not fix the underlying issue.

I see, thank you very much for your help. I will try to add swap and report it to the image maintainer.

Setting memory limits might actually fix it - depending on configuration the JVM may not invoke the garbage collector until it starts to reach capacity. It may also not return free memory to the operating system.

Related threads: java - Does GC release back memory to OS? - Stack Overflow
JEP 346: Promptly Return Unused Committed Memory from G1 etc.

1 Like