Java Code Examples for sun.misc.Unsafe#ADDRESS_SIZE
The following examples show how to use
sun.misc.Unsafe#ADDRESS_SIZE .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestShrinkAuxiliaryData.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Detects maximum possible size of G1ConcRSLogCacheSize available for * current process based on maximum available process memory size * * @return power of two */ private static int getMaxCacheSize() { long availableMemory = Runtime.getRuntime().freeMemory() - ShrinkAuxiliaryDataTest.getMemoryUsedByTest() - 1l; if (availableMemory <= 0) { return 0; } long availablePointersCount = availableMemory / Unsafe.ADDRESS_SIZE; return (63 - (int) Long.numberOfLeadingZeros(availablePointersCount)); }
Example 2
Source File: TestShrinkAuxiliaryData.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Detects maximum possible size of G1ConcRSLogCacheSize available for * current process based on maximum available process memory size * * @return power of two */ private static int getMaxCacheSize() { long availableMemory = Runtime.getRuntime().freeMemory() - ShrinkAuxiliaryDataTest.getMemoryUsedByTest() - 1l; if (availableMemory <= 0) { return 0; } long availablePointersCount = availableMemory / Unsafe.ADDRESS_SIZE; return (63 - (int) Long.numberOfLeadingZeros(availablePointersCount)); }
Example 3
Source File: TestShrinkAuxiliaryData.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Detects maximum possible size of G1ConcRSLogCacheSize available for * current process based on maximum available process memory size * * @return power of two */ private static int getMaxCacheSize() { long availableMemory = Runtime.getRuntime().freeMemory() - ShrinkAuxiliaryDataTest.getMemoryUsedByTest() - 1l; if (availableMemory <= 0) { return 0; } long availablePointersCount = availableMemory / Unsafe.ADDRESS_SIZE; return (63 - (int) Long.numberOfLeadingZeros(availablePointersCount)); }
Example 4
Source File: TestShrinkAuxiliaryData.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Detects maximum possible size of G1ConcRSLogCacheSize available for * current process based on maximum available process memory size * * @return power of two */ private static int getMaxCacheSize() { long availableMemory = Runtime.getRuntime().freeMemory() - ShrinkAuxiliaryDataTest.getMemoryUsedByTest() - 1l; if (availableMemory <= 0) { return 0; } long availablePointersCount = availableMemory / Unsafe.ADDRESS_SIZE; return (63 - (int) Long.numberOfLeadingZeros(availablePointersCount)); }
Example 5
Source File: TestShrinkAuxiliaryData.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Detects maximum possible size of G1ConcRSLogCacheSize available for * current process based on maximum available process memory size * * @return power of two */ private static int getMaxCacheSize() { long availableMemory = Runtime.getRuntime().freeMemory() - ShrinkAuxiliaryDataTest.getMemoryUsedByTest() - 1l; if (availableMemory <= 0) { return 0; } long availablePointersCount = availableMemory / Unsafe.ADDRESS_SIZE; return (63 - (int) Long.numberOfLeadingZeros(availablePointersCount)); }