Traccar 5.3 is using tons of memory

Iván Ávalos2 years ago

Hello, I've been running Traccar since version 5.1. We have ~600 devices in an AWS server with 1 vCPU and 2GB of memory (+1GB swap). Our database is in a MySQL RDS instance. They sound like a lot of devices, but we were handling them just fine, no issues even with the default half gigabyte of heap in the JVM, until we upgraded to 5.3 and everything broke. Now it's taking almost 1.7 GB most of the time, causing OutOfMemory exceptions constantly, no matter how much we increase the memory limit.

This has to be some memory leak, maybe related with the recent architecture changes in the Traccar source code. The server can't be taking this much memory just for no reason, considering it was doing just fine before. I need to find a way to debug the memory leak and fix it, or else it's going to give us much more trouble.

(Update: Traccar starts with 280 MiB, and it slowly ascends to 1.7 GiB.)

Anton Tananaev2 years ago

Does it keep growing with time or does it stop at a certain value?

jay2 years ago

I have about 40 devices, memory is about 1.6GB, My VPS is 16GB Ram. Try to bump up your Memory to 8GB at least.

Anton Tananaev2 years ago

Iván Ávalos please provide a hprof heap dump. Ideally before and after.

Thein Htike2 years ago

Hello Anton,
I had the same issue, it consume all of my memory gradually after 2 hours and stopped working(8082 port is closed and not listening anymore), Device count 150 devices.
CPU:6 vCore

RAM:18 GB

SSD:160 GB

Anton Tananaev2 years ago

OK. Have you already collected heap dumps?

Thein Htike2 years ago

how to create small heap dumps that you want. As I heap dump, that heap dump file exceeds over alot of GBs, since I have slow connection I cannot able to provide to you. Right now , I restart traccar for every 30min to release some RAM but it is not right solution I know.

Anton Tananaev2 years ago

I don't think you can reduce the size of the dump, but maybe you can check it yourself and compare.

Victor Butlera year ago

Hi, did you manage to figure out the potential memory leak issue?