public final class MemoryCleaner extends Object
This class provides methods to clear heap memory, delete temp files, and clear font registry information. It also includes a method to safely clear thread-local instances for the current thread.
Example usage:
// Clean heap memory, keeping font settings
MemoryCleaner.clearKeepingFontSettings();
// Clean heap memory and delete temp files
MemoryCleaner.clear();
// Clean heap memory from static PDF instances
MemoryCleaner.clearStaticInstances();
// Delete all temp files created by PDF in the system temp directory
MemoryCleaner.clearAllTempFiles();
// Clear font registry information from heap memory
MemoryCleaner.clearFontRegistry();
// Safely clear thread-local instances for the current thread
MemoryCleaner.clearCurrentThreadLocals();
| Constructor and Description |
|---|
MemoryCleaner() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clear()
Clears heap memory from static PDF instances (static and threadLocal) and deletes all temp files.
|
static void |
clearAllTempFiles()
Clears temp files created by GroupDocs.Viewer in the system temp directory.
|
static void |
clearCurrentThreadLocals()
Safely clears heap memory from thread-local instances for the current thread.
|
static void |
clearFontRegistry()
Clears font registry information from heap memory.
|
static void |
clearKeepingFontSettings()
Clears heap memory from static PDF instances (static and threadLocal) and deletes all temp files.
|
static void |
clearStaticInstances()
Clears heap memory from static PDF instances.
|
public static void clear()
Clears heap memory from static PDF instances (static and threadLocal) and deletes all temp files.
public static void clearAllTempFiles()
Clears temp files created by GroupDocs.Viewer in the system temp directory.
public static void clearCurrentThreadLocals()
Safely clears heap memory from thread-local instances for the current thread.
public static void clearFontRegistry()
Clears font registry information from heap memory.
public static void clearKeepingFontSettings()
Clears heap memory from static PDF instances (static and threadLocal) and deletes all temp files. This method does not affect font settings.
public static void clearStaticInstances()
Clears heap memory from static PDF instances.
Copyright © 2024. All rights reserved.