Confused about RAM usage

starkita 4 years ago

Hello,
I have deployed a small traccar server from the docker image, and I am seeing 6 GB of RAM allocated to it, while I expected much more. I have both tried building from the dockerfile or using the image provided.

I am very confused, what am I doing wrong?

Anton Tananaev 4 years ago

Why did you expect more?

starkita 4 years ago

I expected less :)

I am testing for a very small use case, about 10 vehicles. It is a lot of RAM for such a small deployment, I do believe.

Is it right for it to be this high? I am ignorant on the specifics of this software.

EDIT: Also, I expected about 512MB, because of the Java entry point. But then again, I may just have misunderstood that 512MB reference.

Anton Tananaev 4 years ago

It could be related to the way Java handles memory allocation. It pre-allocates some memory for JVM even if the process doesn't use that much yet.

Anton Tananaev 4 years ago

I expected about 512MB, because of the Java entry point

Can you explain what you mean?

starkita 4 years ago

It spawns quite a few workers, each with about 350 MBof RAM as you can see: https://imgur.com/a/v4PZNrE

I am using the unmodified Debian Dockerfile

EDIT:

I expected the whole software usage to be 512 MB of Ram. The entrypoint has "-Xms512m", "-Xmx512m".

I do remember one specifies the maximum ram, the other the initially allocated RAM: could I tweak that setting to avoid this huge ram usage?

Anton Tananaev 4 years ago

That doesn't look right.. why are there so many processes? There should be one.

starkita 4 years ago

This is the docker-compose.yml I am using, I wrote it myself (just censored the details of passwords).
I did expose more ports to make a few tries, but it should not affect things.

I am using the Debian Dockerfile.

version: '3'
services:
  app:
    build: .
    #image: 'traccar/traccar:latest'
    container_name: traccar
    restart: unless-stopped
    ports:
      - '8052:8082'
      - '5000-5150:5000-5150/udp'
      - '5000-5150:5000-5150'
      - '50000-50150/udp'
      - '50000-50150'
    volumes:
      - ./traccar/logs:/opt/traccar/logs:rw
      - ./traccar/traccar.xml:/opt/traccar/conf/traccar.xml:ro
      - ./traccar/data:/opt/traccar/data:rw
    depends_on:
      - traccar_db
  traccar_db:
    image: 'jc21/mariadb-aria:latest'
    restart: unless-stopped
    container_name: traccar_db
    environment:
      MYSQL_ROOT_PASSWORD: 'password'
      MYSQL_DATABASE: 'db'
      MYSQL_USER: 'user'
      MYSQL_PASSWORD: 'password'
    volumes:
      - ./mysql:/var/lib/mysql:rw
Anton Tananaev 4 years ago

Have you tried running standalone docker image without docker compose? If it's also happening there, you can probably log a bug on github.

starkita 4 years ago

I'll do it right now.

starkita 4 years ago

Using the docker run command from the github page it does not remain up.

I will check back in an hour or so.

starkita 4 years ago

Alright, I did some testing.

https://imgur.com/a/uVh2rQ5

There are still A TON of processes using the docker run from the github page, but ram usage is definitely down.

Very confusing.

Anton Tananaev 4 years ago

I recommend asking on GitHub. I'm not very familiar with docker setup.

starkita 4 years ago

Will do, thanks!

starkita 4 years ago

Is the docker github mantained?