#571

Windows: tray app commits ~32 MB steps while idle on 2.0.1 (reached ~30 GB); 2.0.3-beta.11 fails to initialize JavaScriptCore

Opendjalmajropened 22d ago

Summary

On Windows, a tray-only Electrobun 2.0.1 app keeps committing memory in ~32 MB steps while doing nothing. One instance reached ~30 GB of private (committed) memory after three days with a working set of only ~1.5 GB, which exhausted the machine's commit limit. Trying 2.0.3-beta.11 to pick up the Cottontail memory work, the main process does not start: cottontail.exe prints failed to initialize the embedded JavaScriptCore runtime.

Environment

  • Windows 11 Pro 26200, x64
  • App: tray only (Tray, setMenu, no BrowserWindow/webview), bundleCEF: false
  • Built with Hutch; Electrobun 2.0.1 (Cottontail 0.5.0) and 2.0.3-beta.11 (Cottontail 0.7.2-canary.6)

1. Idle memory growth on 2.0.1

Three copies of the same app ran side by side for 20 minutes, each with its own data folder. All three wrote their instance lock file, so their JavaScript was running.

  • idle: creates the Tray, calls setMenu once, and keeps a 2 s setInterval whose callback returns immediately
  • fetch: the same, plus one fetch() to a local HTTP health endpoint every 2 s
  • full: the app's normal 2 s loop

Private bytes (PrivatePageCount), MB:

minuteidlefetchfull
01,1471,1051,249
101,1751,1301,230
201,2421,1671,337

Growth comes in ~32 MB steps a few minutes apart, even in idle. The working set stays around 250 MB. A long-running instance grew ~8 MB/min on average (1,275 → 1,810 MB in 64 min; the 3-day instance reached ~29.8 GB).

The same fetch loop under plain Bun 1.4.0 stays flat (+6 MB after 1,500 requests), so the growth looks specific to the Electrobun runtime / native event loop.

2. 2.0.3-beta.11 does not start on Windows

Same app, only the Electrobun version changed in the Hutch config. The build succeeds (Hutch downloads the 2.0.3-beta.11 core and Cottontail 0.7.2-canary.6). At runtime:

> cottontail.exe ..\Resources\main.js
cottontail: failed to initialize the embedded JavaScriptCore runtime

Started through launcher.exe, the process stays alive at ~500 MB but never runs the app's JavaScript: no tray menu actions, no lock file written, no child processes started.

Expected

  • 2.0.x: committed memory stays flat for an idle tray app.
  • 2.0.3 betas: the main process starts on Windows x64.

Happy to run a build or a diagnostic binary if that helps.

Activity

0

No activity yet.