Huge usage of memory

Barca5 years ago

Hello,
when I unpack traccar-other-4.3.zip or traccar-other-4.2.zip and run it, the usage of memory of Traccar server immediately reaches 20GB and doesn't stop. Logs doesn't mention anything special. This is happening every time you try to start the server, no matter how you run it (via Putty, via cron), no matter which version of Java you use etc.
The problem started when I replaced my 4.2 version with 4.3. Just after update (replace) version 4.3 worked fine a couple hours and then the memory usage got insane. And now it is happing every time I start the server, even on pure installation (without copying my configuration files and databases).
Thank you for your remarks.

Anton Tananaev5 years ago

Is it real usage or just virtual memory?

Barca5 years ago

htop says that there's 19,4G VIRT, 416MB RES, 20432 SHR, 0,5% CPU and 1,3% MEM.
The only message which is given sometimes by Traccar is:

$ java -jar tracker-server.jar conf/traccar.xml
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/home/barca/Traccar/lib/guice-4.2.2.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Anton Tananaev5 years ago

It seems like it's just virtual memory. I don't see any issue with it. What is the problem?

Barca5 years ago

The problem is that it never happened before, my server administrators are mad and wants me to hang because of that.

Anton Tananaev5 years ago

Your administrators are incompetent if they are worried about virtual memory allocation.

Barca5 years ago

The problem is that when Traccar reserves for itself 20GB VRAM, traccar-server. jar can use 20GB just when it wants. So it's great risk for whole server that one process can take all physical memory just when it wants. So no, they are definitely competent and I must respect their expectations.
Can you make an application more modest? Couldn't it reserve less VRAM?

Anton Tananaev5 years ago

You can control memory allocation using Java command line arguments if you want. It has nothing to do with the app.

Edilon Carvalho 4 years ago

Anton.

My server with 2GB of memory presented the error message in the log: "memory limit heap: 496 non-heap: 0

I upgraded to traccar 4.8,
I increased the memory to 4GB
I added the "entry web.timeout 7500" in traccar.xml and set the memory limit to 1GB in etc / systemd / system / traccar.service,
I also changed the restart of the traccar service every 6 hours to 24 hours but after that I noticed that the service starts to increase memory usage but it didn't reach its limit. Is this normal then? Is there another way to resolve this?