Package org.pushingpixels.substance.internal.utils

# Class MemoryAnalyzer

java.lang.Object
java.lang.Thread
org.pushingpixels.lafwidget.utils.TrackableThread
org.pushingpixels.substance.internal.utils.MemoryAnalyzer

All Implemented Interfaces:
  `Runnable`

public class MemoryAnalyzer extends org.pushingpixels.lafwidget.utils.TrackableThread
Tracer for memory usage patterns of Substance look-and-feel. The tracer is started when VM has `-Dsubstancelaf.traceFile` flag. The value of this flag specifies the location of trace log file. When activated, the tracer runs a thread that collects information on memory usage and appends it to the trace log file every `X` seconds. The `X` (delay) is specified in the constructor. This class is for internal use only.

## Nested Class Summary

## Nested classes/interfaces inherited from class java.lang.Thread

`Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler`

## Field Summary

### Fields inherited from class java.lang.Thread

`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

## Method Summary

Modifier and Type
Method
Description
`static void`
`commence(long delay, String filename)`
Starts the memory tracing.
`static void`
`enqueueUsage(String usage)`
Adds usage string.
`static ArrayList<String>`
`getUsages()`
Returns all queued usages.
`static boolean`
`isRunning()`
Checks whether tracer is running.
`void`
`requestStop()`
Issues request to stop tracing.
`void`
`run()`

### Methods inherited from class org.pushingpixels.lafwidget.utils.TrackableThread

`requestStopAllThreads`

### Methods inherited from class java.lang.Thread

`activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield`

### Methods inherited from class java.lang.Object

`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Method Details

### commence

public static void commence(long delay, String filename)
Starts the memory tracing.

Parameters:
  `delay` - Sleep delay between trace log iterations.
  `filename` - Trace logfile name.

### requestStop

public void requestStop()
Issues request to stop tracing.

Specified by:
  `requestStop` in class `org.pushingpixels.lafwidget.utils.TrackableThread`

### isRunning

public static boolean isRunning()
Checks whether tracer is running.

Returns:
  `true` if tracer is running, `false` otherwise.

### enqueueUsage

public static void enqueueUsage(String usage)
Adds usage string.

Parameters:
  `usage` - Usage string. Will be output to the trace file at next iteration of the tracer.

### getUsages

public static ArrayList<String> getUsages()
Returns all queued usages.

Returns:
  All queued usages.

### run

public void run()

Specified by:
  `run` in interface `Runnable`
Overrides:
  `run` in class `Thread`