Files
browser/src
Karl Seguin e3b605c35d idb: improve indexeddb memory model
Rather than having everything tied to the page's memory (arena, factory), most
things are now tied to an IDBTransaction and its arena. The IDBTransaction is
reference counted and finalized with v8. The lifecycle is relatively complicated
compared to anything else we have, which is a concern, but using the page arena
seems like a dealbreaker to me.

Any "child" created for the transaction (e.g. IDBRequest) has its v8 acquireRef
and releaseRef forwarded to the Transaction. This should make v8's usage safe.
However, in addition to this, Zig itself must take a RC whenever a drain is
scheduled AND whenever the transaction is parked in the engine. And these
things, especially on cleanup, can be a little messy.

The _awful_ cursor allocations have been improved by a local re-used ArrayLists
for the key/primary key/value. So rather than accumulating _every_ allocation
we now only capture the peak.

One final memory-related area this commit addresses is the lifetime difference
between Transactions (Page) and Engine (Session). This is problematic because
the Engine can reference the Transaction. On js.Context deinit, the engine is
notified and all related Transactions are canceled/removed. This is...unusual
in our design. We have other similar cases that use a list on the frame/GWS to
track resources to cleanup. But, the Engine already _has_ to have this list so
rather than book-keeping in Engine AND Frame AND WGS, only Engine has a list at
the cost of js.Context having to notify it on teardown.
2026-07-03 07:10:03 +08:00
..
2026-07-02 21:06:51 +08:00
2026-04-22 08:42:18 +08:00
2026-06-24 17:44:58 +08:00
2026-06-29 08:05:05 +02:00
2026-07-03 07:10:01 +08:00
2026-07-02 08:46:22 +03:00
2026-06-24 18:16:02 +08:00
2026-07-03 07:10:02 +08:00
2026-05-29 09:32:03 +08:00
2026-04-10 06:51:10 +08:00
2026-07-02 11:23:45 +02:00
2026-06-24 07:01:29 +08:00
2026-05-25 18:05:11 +02:00
2026-01-24 07:59:41 +08:00
2026-06-17 13:56:40 +08:00