Neo4j is based on the JVM, its memory depends on the size of the heap.
If you have not configured your size, Neo4j has heursitic to calculate it, and by the time this heuristic has changed.
Neo4j 3.X has 3 memory spaces:
a bunch of jvm
The heap is used to store all transaction data, block nodes and relationships, and also to cache the query execution plan.
You can adjust its size in conf/neo4j.conf :
Page Cache
The database does a lot of disk I / O. To be fast, he needs to put his data in RAM. Neo4j 3.X does this using the pagecache mechanism, which places some parts of its binary data files into RAM. Therefore, your most frequently used data is in RAM.
This can be configured in conf/neo4j.conf :
Indices
Indexes are used to quickly search for nodes for your queries, but if these indexes are not in RAM, they will be slow.
It is not possible to configure this memory array in Neo4j, but with rule three it is easy to calculate it (Server RAM = Heap + pagecache + indexes + some free memory for the OS).
You can calculate the size of your indexes with this command:
$> du -sh data/databases/graph.db/indexes
Conclusion
Since Neo4j 2, there are many improvements (functionality, features), so yes, it is more efficient.
I donβt know a more effective way to print fingers on RAM, I have never done such a test, but RAM is now cheap.
The only thing I can tell you is that you need a smaller heap, now the data cache is disabled. In 2.X, Neo4j saved a graph in memory for quick access.
But Neo4j is very configurable, so if you have a tiny server and you want to fine tune memory consumption, you need to set the heap and pagecache sizes.