April 26, 2016
Many users ask how much memory is consumed by OrientDB and which settings affect this. This question becomes even more pertinent since the OrientDB 2.2 release. In this latest release, we allocate memory in big chunks (about of 1gb size each) and then split it between threads on demand.
So how do you calculate maximum amount of memory consumed by OrientDB? The answer to that is simple. OrientDB uses both heap and direct memory. Direct memory is used in disk cache and database journal.
Memory consumed by disk cache may be calculated looking at the value of the storage.diskCache.bufferSize configuration parameter, which shows the maximum amount of memory consumed by disk cache in megabytes. The page cache size in kilobytes may be retrieved by reading the value of the storage.diskCache.pageSize parameter. It may be done using the console CONFIG GET command for example.
You may get the maximum amount of pages consumed by the database journal by reading the value of the storage.wal.cacheSize parameter. You should increase this value by 1 and multiply by the value of the storage.diskCache.pageSize parameter. In this way you will get the maximum amount of direct memory consumed by the database journal. After that we need to add both calculated values and increase the result until not divisible by 1GB without reminder.
The rest is simple. Add the value which you calculated above and add the amount of memory consumed by heap and you will get the maximum amount of memory which will be consumed by OrientDB.
UPDATE 1: Maximum size of memory chunk in bytes which will be allocated by OrientDB may be set using the memory.chunk.size property.
If you have any questions about this blog entry or about any of OrientDB’s features please post your question on stackoverflow and we will answer it. For a complete guide on OrientDB’s features and properties be sure to read our Documentation.