Extension: omni.resourcemonitor-107.1.1 |
Documentation Generated: Oct 09, 2025 |
Overview#
The Resource Monitor extension provides a utility for monitoring device and host memory usage. It integrates a resource monitoring interface into the Omni UI, managing both the acquisition of resource statistics and the registration of a corresponding preferences page. This extension is designed to help developers track available memory, trigger warnings on low memory conditions, and integrate memory monitoring into their workflows.

Concepts#
IResourceMonitor Interface: Provides methods to query available and total memory for both device and host.
ResourceMonitorEventType: An enumeration that distinguishes between different memory-related events, such as DEVICE_MEMORY, HOST_MEMORY, LOW_DEVICE_MEMORY, and LOW_HOST_MEMORY.
Functionality#
Interface Management: Developers can acquire the resource monitor interface using
[acquire_resource_monitor_interface](omni.resourcemonitor/omni.resourcemonitor.acquire_resource_monitor_interface)
and must release it with[release_resource_monitor_interface](omni.resourcemonitor/omni.resourcemonitor.release_resource_monitor_interface)
to ensure proper resource cleanup.Event Handling: The extension exposes an event stream through the IResourceMonitor interface. This allows applications to register callbacks for memory-related alerts and take appropriate action when low memory conditions are detected.
Integration with Omni UI: On startup, the extension checks application settings and optionally registers a preferences page, enabling users to adjust memory monitoring parameters and thresholds via preset settings keys (e.g.,
deviceMemoryWarnFractionSettingName
,hostMemoryWarnMBSettingName
, etc.).
Relationships#
Dependencies: The extension lists a dependency on “omni.gpu_foundation,” indicating a reliance on GPU-related functionality for monitoring device memory.
Extension Integration: It hooks into the overall extension manager of the application by handling enable/disable events to register or unregister its preferences page, ensuring that the resource monitoring UI remains consistent with user settings.
Considerations#
Robustness: The extension is designed to gracefully handle scenarios where required modules might not be present by catching ModuleNotFoundError exceptions.
Resource Management: Proper acquisition and release of the resource monitor interface are key to avoiding resource leaks, making it important to follow the prescribed usage pattern.
Memory Thresholds: Preset settings keys and associated configuration help manage when warnings are triggered, though any changes to thresholds should be done with care to match the specific application’s memory management needs.
In essence, the Resource Monitor extension offers a practical way to integrate memory usage monitoring into your application, providing both real-time statistics and event notifications to help manage system resources effectively.