Package org.codelibs.fess.util
Class MemoryUtil
java.lang.Object
org.codelibs.fess.util.MemoryUtil
Utility class for memory operations and size calculations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringbyteCountToDisplaySize(long size) Converts byte count to human-readable size format.static StringGets a formatted memory usage log string.static longGets the currently used memory in bytes.static longEstimates the size of an object in bytes.
-
Method Details
-
getMemoryUsageLog
Gets a formatted memory usage log string.- Returns:
- formatted memory usage information
-
byteCountToDisplaySize
Converts byte count to human-readable size format.- Parameters:
size- the size in bytes- Returns:
- formatted size string
-
getUsedMemory
public static long getUsedMemory()Gets the currently used memory in bytes.- Returns:
- used memory in bytes
-
sizeOf
Estimates the size of an object in bytes.- Parameters:
obj- the object to calculate size for- Returns:
- estimated size in bytes
-