Java heap space - OutOfMemoryError

Tracking Faso9 months ago

hello,
I use version 5.12 of traccar with docker, I constant if I want to generate a report with a lot of data I have an error

Java heap space - OutOfMemoryError

however I still have 4g memory available in my server. I also saw that it is possible to allocate more memory. My question is how do we allocate the memory?
should I add this line below in my config file traccar.xml?

ExecStart=/opt/traccar/jre/bin/java -Xmx2G -jar tracker-server.jar

If not how should I proceed please help me

Anton Tananaev9 months ago

Have you tried increasing the heap limit?

Tracking Faso9 months ago

@Anton Tananaev

how to do this please?

Anton Tananaev9 months ago

You already provided an example.

Tracking Faso9 months ago

in reality I don't know how to integrate, should I put the first or the second in my configuration file?

ExecStart=/opt/traccar/jre/bin/java -Xmx2G -jar tracker-server.jar conf/traccar.xml

or

ExecStart=/opt/traccar/jre/bin/java -Xmx2G -jar tracker-server.jar
Anton Tananaev9 months ago

You should just add -Xmx2G to whatever is there by default. You can try even higher number. Maybe 3G.

Tracking Faso9 months ago

I did as you said and I put 6G because I have enough ram memory on my server, you can see the image captures of my configuration file and my logs. we can see that nothing to change, can you guide me to correct this?

traccar.xml

traccar.xml config

logs info

traccar.xml config

Anton Tananaev9 months ago

The line doesn't go into the Traccar config file. It goes in the service config.

Tracking Faso9 months ago

@Anton Tananaev
i use traccar docker , how can access to config traccar service?

Anton Tananaev9 months ago

In that case the configuration is in the dockerfile.

Tracking Faso8 months ago

@Anton Tananaev
thank you, now is ok