HeapMemoryWidget
HeapMemoryWidget is a small diagnostic widget that displays browser JS heap usage in gigabytes.
Import
import {HeapMemoryWidget} from '@deck.gl-community/widgets';
Props
type HeapMemoryWidgetProps = WidgetProps & {
placement?: WidgetPlacement;
pollIntervalMs?: number;
};
Usage
new Deck({
widgets: [new HeapMemoryWidget({pollIntervalMs: 1000})]
});
Notes
This is a debugging/observability widget. It depends on browser support for performance.memory, so it is not guaranteed to show data in every environment.
Remarks
- Polls
window.performance.memoryon an interval. - Displays used heap in GB.
- Uses a background gradient to show used, reserved, and remaining capacity.
- Falls back to
N/Awhen the browser does not expose heap metrics. - Enforces a minimum effective poll interval of 500ms.
Default props:
id: 'heap-memory'placement: 'top-right'pollIntervalMs: 2000