From 930ffb5581d883367316d1360399f399a929597d Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Wed, 27 May 2026 18:18:10 +0800 Subject: [PATCH] Notify v8 of memory pressure on session.deinit https://github.com/lightpanda-io/browser/pull/2548 removed the _need_ to call v8::Isolate::MemoryPressureNotification on Session.deinit and actually removed the call. But [my theory] is that this causes our peak memory to be higher. So, I'm adding it back. The point of #2548 was to open the door for improving the memory signals to v8 by removing the _need_ for this specific signal. That PR made it so that, for correctness (UAF) we no longer _had_ to call it. The point of the PR wasn't to necessarily improve the signals, so I don't feel too bad about putting this back in. --- src/browser/Session.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/browser/Session.zig b/src/browser/Session.zig index 4bd4259f..ce8c2470 100644 --- a/src/browser/Session.zig +++ b/src/browser/Session.zig @@ -131,6 +131,8 @@ pub fn deinit(self: *Session) void { self.cookie_jar.deinit(); + self.browser.env.memoryPressureNotification(.critical); + self.storage_shed.deinit(self.browser.app.allocator); self.arena_pool.release(self.arena); }