Java heap space - OutOfMemoryError

Tracking Fasoa year 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 Tananaeva year ago

Have you tried increasing the heap limit?

Tracking Fasoa year ago

@Anton Tananaev

how to do this please?

Anton Tananaeva year ago

You already provided an example.

Tracking Fasoa year 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 Tananaeva year ago

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

Tracking Fasoa year 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 Tananaeva year ago

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

Tracking Fasoa year ago

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

Anton Tananaeva year ago

In that case the configuration is in the dockerfile.

Tracking Fasoa year ago

@Anton Tananaev
thank you, now is ok