Package testhelper
Class PerformanceUtils
- java.lang.Object
-
- testhelper.PerformanceUtils
-
public class PerformanceUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.reflect.Method
GET_THREAD_ALLOCATED_BYTES
private static java.lang.management.ThreadMXBean
THREAD_MX_BEAN
-
Constructor Summary
Constructors Constructor Description PerformanceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
canMeasureAllocatedMemory()
private static java.lang.reflect.Method
initGetThreadAllocatedBytes()
static long
measureAllocatedMemory()
-
-
-
Method Detail
-
initGetThreadAllocatedBytes
private static java.lang.reflect.Method initGetThreadAllocatedBytes()
-
canMeasureAllocatedMemory
public static boolean canMeasureAllocatedMemory()
-
measureAllocatedMemory
public static long measureAllocatedMemory()
- Returns:
- amount of memory (in bytes) allocated by current thread until now
-
-