Since 2.1.16 and 2.2 versions of OrientDB, it will be possible to change the size of direct memory disk cache at runtime.
That is quite simple to do, merely call
com.orientechnologies.orient.core.config.OGlobalConfiguration#DISK_CACHE_SIZE.setValue()at any place in your program and size of disk cache will be changed (passed in value is cache size in megabytes). You may do this inside of your code or using OrientDB console or Studio.
There are couple of nuances of usage of given feature:
- If you increase cache size that is pretty cheap operation.
- If you decrease cache size it may take some time because previously loaded pages have to be freed.
- If you decrease cache size you may get (but the probability that it may happen is really low)
IllegalStateExceptionwhich tells you that cache does not have enough memory to keep pinned pages inside of RAM