# France installation Java heap space error

**URL:** https://ask.openrouteservice.org/t/france-installation-java-heap-space-error/1843
**Category:** openrouteservice
**Created:** [June 23, 2020, 6:50pm UTC](https://ask.openrouteservice.org/t/france-installation-java-heap-space-error/1843 "2020-06-23T18:50:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![CMonjo](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/cmonjo/32/605_2.png) [@CMonjo](https://ask.openrouteservice.org/u/CMonjo)
#### Post date: [June 23, 2020, 6:50pm UTC](https://ask.openrouteservice.org/t/france-installation-java-heap-space-error/1843/1 "2020-06-23T18:50:00Z")

</div>

Hi,

I post again on a new problem ahah

I spent the afternoon digging around to understand this error:

 ![Screenshot 2020-06-23 at 20.31.38](https://ask.openrouteservice.org/uploads/default/original/1X/151bea0d3436a12695a2c16e77e129cafd5cd617.png)

I am trying to install a pbf for the whole of France (3.6GB)

I searched your forum ([https://ask.openrouteservice.org/t/source-point-s-0-1-2-3-4-n-out-of-bounds](https://ask.openrouteservice.org/t/source-point-s-0-1-2-3-4-n-out-of-bounds)), as well as the github wiki, but I can’t figure out how to change the Java configuration in Docker.  
Here is my configuration, which is the basic one:

```
- "JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Xms1g -Xmx2g"

```

I can’t seem to figure out how to change the settings according to this sentence in the wiki:

> It should be mentioned that if your dataset is very large, please adjust the `-Xmx` parameter of` JAVA_OPTS` environment variable. A good rule of thumb is to give Java 2 x file size of the PBF \*\* per profile \*\*.

I’m running Docker on a MacBook Pro 2016, RAM : 16Go and processor : 2,6 GHz Quad-Core Intel Core i7

Thanks alot !

Camille

---

<div class="post-metadata">

### Author: ![adam](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/adam/32/8_2.png) [@adam](https://ask.openrouteservice.org/u/adam)
#### Post date: [June 24, 2020, 6:16am UTC](https://ask.openrouteservice.org/t/france-installation-java-heap-space-error/1843/2 "2020-06-24T06:16:51Z")

</div>

The heap is what Java uses for storing objects in memory, and so you need to change the -Xmx2g parameter. Basically, the `-Xmx` part is what says “the maximum heap size is…” and the `2g` is the amount of memory. We recommend a heap size of double the pbf size, so for a pbf size of 3.6GB you should change `-Xmx2g` to `-Xmx8g` which will allow 8GB of the machines RAM to be used as the Java heap. Be careful when not using a dedicated machine though as this just tells Java it can use 8GB, but if there isn’t 8GB of free space (because of other things running on the machine) then your system could become unstable.

You can also consider changing `-Xms1g` to `-Xms8g` aswell, which then will straight away reserve 8GB of the RAM for the java heap which no other process on the machine can then get hold of (basically rather than it gradually allocating RAM up to 8GB, it would start with 8GB RAM as heap).

---

<div class="post-metadata">

### Author: ![CMonjo](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/cmonjo/32/605_2.png) [@CMonjo](https://ask.openrouteservice.org/u/CMonjo)
#### Post date: [June 24, 2020, 7:57am UTC](https://ask.openrouteservice.org/t/france-installation-java-heap-space-error/1843/3 "2020-06-24T07:57:46Z")

</div>

Hi,

I’ve try to launch with this conf, hop thats work, thanks!
