Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
MemoryLogger(org.slf4j.Logger logger,
long interval,
CompletableFuture<Void> monitored)
Creates a new memory logger that logs in the given interval and lives until the given
termination future completes.
|
Modifier and Type | Method and Description |
---|---|
static String |
getDirectMemoryStatsAsString(BufferPoolMXBean bufferPoolMxBean)
Returns a String with the direct memory footprint.
|
static String |
getGarbageCollectorStatsAsString(List<GarbageCollectorMXBean> gcMXBeans)
Gets the garbage collection statistics from the JVM.
|
static String |
getMemoryPoolStatsAsString(List<MemoryPoolMXBean> poolBeans)
Gets the memory pool statistics from the JVM.
|
static String |
getMemoryUsageStatsAsString(MemoryMXBean memoryMXBean)
Gets the memory footprint of the JVM in a string representation.
|
void |
run() |
void |
shutdown() |
static void |
startIfConfigured(org.slf4j.Logger logger,
Configuration configuration,
CompletableFuture<Void> taskManagerTerminationFuture) |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public MemoryLogger(org.slf4j.Logger logger, long interval, CompletableFuture<Void> monitored)
logger
- The logger to use for outputting the memory statistics.interval
- The interval in which the thread logs.monitored
- termination future for the system to whose life the thread is bound. The
thread terminates once the system terminates.public static void startIfConfigured(org.slf4j.Logger logger, Configuration configuration, CompletableFuture<Void> taskManagerTerminationFuture)
public void shutdown()
public static String getMemoryUsageStatsAsString(MemoryMXBean memoryMXBean)
public static String getDirectMemoryStatsAsString(BufferPoolMXBean bufferPoolMxBean)
These stats are not part of the other memory beans.
bufferPoolMxBean
- The direct buffer pool bean or null
if none available.public static String getMemoryPoolStatsAsString(List<MemoryPoolMXBean> poolBeans)
poolBeans
- The collection of memory pool beans.public static String getGarbageCollectorStatsAsString(List<GarbageCollectorMXBean> gcMXBeans)
gcMXBeans
- The collection of garbage collector beans.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.