/** * Checks the OrientDB cache memory configuration and emits a warning if configuration is invalid. */ public static void checkCacheMemoryConfiguration() { final long maxHeapSize = Runtime.getRuntime().maxMemory(); final long maxCacheSize = getMaxCacheMemorySize(); final ONative.MemoryLimitResult physicalMemory = ONative.instance().getMemoryLimit(false); if (maxHeapSize != Long.MAX_VALUE && physicalMemory != null && maxHeapSize + maxCacheSize > physicalMemory.memoryLimit) OLogManager.instance().warnNoDb(OMemory.class, "The sum of the configured JVM maximum heap size (" + maxHeapSize + " bytes) " + "and the OrientDB maximum cache size (" + maxCacheSize + " bytes) is larger than the available physical memory size " + "(" + physicalMemory + " bytes). That may cause out of memory errors, please tune the configuration up. Use the " + "-Xmx JVM option to lower the JVM maximum heap memory size or storage.diskCache.bufferSize OrientDB option to " + "lower memory requirements of the cache."); }