+
+ Loads the 452 MB NYC-taxi parquet via registerFileBuffer, creates a view, runs varied SQL, and
+ measures DuckDB memory + measureUserAgentSpecificMemory() (true per-context incl. WASM worker).
+
+
+ status: {status} {busy ? '(busy…)' : ''}
+
+
+
+
+ {POC_QUERIES.map((q) => (
+
+ ))}
+
+
+
+
+
+
+
+
+
+
+ samples: {snapshots.length}
+ DuckDB: {formatBytes(last?.duckDbUsedBytes ?? null)}
+
+ globFiles: {formatBytes(last?.duckDbFileBytes ?? null)} ({last?.duckDbFileCount ?? 0})
+
+
+ UA total (incl. WASM): {formatBytes(last?.uaTotalBytes ?? null)}
+
+ JS heap: {formatBytes(last?.jsHeapUsedBytes ?? null)}
+
+
+ {last && Object.keys(last.uaByType).length > 0 ? (
+
+ UA by type:
+ {Object.entries(last.uaByType)
+ .sort((a, b) => b[1] - a[1])
+ .map(([t, b]) => (
+
+ {t}: {formatBytes(b)}
+
+ ))}
+
+ ) : null}
+
+
+
+
+ | # |
+ t(s) |
+ event |
+ DuckDB |
+ globFiles |
+ UA total |
+ JS heap |
+
+
+
+ {snapshots.map((s) => (
+
+ | {s.iteration} |
+ {(s.atMs / 1000).toFixed(1)} |
+ {s.label} |
+ {formatBytes(s.duckDbUsedBytes)} |
+ {formatBytes(s.duckDbFileBytes)} |
+ {formatBytes(s.uaTotalBytes)} |
+ {formatBytes(s.jsHeapUsedBytes)} |
+
+ ))}
+
+
+
+ );
+};
diff --git a/benchmarking/src/app/memory-poc/memory-probe.ts b/benchmarking/src/app/memory-poc/memory-probe.ts
new file mode 100644
index 00000000..ce839b5c
--- /dev/null
+++ b/benchmarking/src/app/memory-poc/memory-probe.ts
@@ -0,0 +1,183 @@
+import { DBM, InstanceManagerType } from '@devrev/meerkat-dbm';
+
+/**
+ * One memory snapshot of the DuckDB WASM engine + the browser process. Because
+ * the benchmark app is cross-origin isolated (COOP/COEP set in vite.config), we
+ * can call measureUserAgentSpecificMemory() — which reports the TRUE per-context
+ * heap including the DuckDB WASM worker, the number performance.memory (main
+ * thread only) misses.
+ */
+export interface MemorySnapshot {
+ iteration: number;
+ atMs: number;
+ label: string;
+ /** DuckDB buffer-manager total, bytes — sum over duckdb_memory() tags. */
+ duckDbUsedBytes: number | null;
+ /** Per-tag DuckDB memory (PARQUET_READER, HASH_TABLE, ORDER_BY, WINDOW, …). */
+ duckDbByTag: Record