Search code examples
performanceneo4jconfigurationheap-memorypage-caching

Neo4j Heap and pagecache configuration


I'm running neo4j 3.2.1 on Linux machine of 16GB RAM, yet I'm having issues ith the heap memory showing an error everytime.

In the documentation, we have:

Actual OS allocation = available RAM - (page cache + heap size)

Does it mean that if we configure it for my machine (for example 16g for the heap and 16g for page cache) then the Allocation would be 0, inducing the problem?

Can anyone tell me how to proceed with the best configuration to explore more of the capacity of the machine without having to face that heap error again?


Solution

  • In your example, you are trying to give all the RAM to the page cache, and also all the RAM to the heap. That is never possible. The available RAM has to be divided between the OS, the page cache, and the heap.

    The performance documentation shows how to divide up the RAM.

    As a first pass, you could try this allocation (given your 16 GB of RAM):

    • 7 GB for the page cache
    • 8 GB for the heap

    That will leave (16GB - (7GB + 8GB)), or 1 GB for the OS.

    But you should read the documentation to fine tune your allocations.