07a38be5a9
Opening the export menu imported onnxruntime-web, and importing that runtime is what starts its thread pool: one Web Worker per thread, each holding a copy of the 27MB wasm build, held by the page until it dies whether or not an export is ever asked for. Those workers are the child processes a visitor finds hanging off the tab (and the tab, and the browser, goes when one of them is killed), and the memory is what a laptop has none of when the studio is closed and opened again. The menu now fetches the files by name and lets the browser's cache do the warming; the runtime is imported by the export that needs it. The threads are capped at four, and pagehide hands the session back instead of leaving the renderer to reap it with the page.