From bddf523ac9d201a1d15aa8b938b516aa1a6949aa Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Thu, 1 Dec 2022 02:34:15 -0800 Subject: Reduce memory usage in Bun.serve() by up to 3x (#1569) * Update WebKit * Use 5x less memory in Bun.serve() * Update Dockerfile.devcontainer * Update async-overhead.mjs Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> --- src/bun.js/javascript.zig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/bun.js/javascript.zig') diff --git a/src/bun.js/javascript.zig b/src/bun.js/javascript.zig index 6f966df2b..54fec7a96 100644 --- a/src/bun.js/javascript.zig +++ b/src/bun.js/javascript.zig @@ -1333,6 +1333,7 @@ pub const VirtualMachine = struct { // pending_internal_promise can change if hot module reloading is enabled if (this.bun_watcher != null) { + this.eventLoop().performGC(); switch (this.pending_internal_promise.status(this.global.vm())) { JSC.JSPromise.Status.Pending => { while (this.pending_internal_promise.status(this.global.vm()) == .Pending) { @@ -1346,6 +1347,7 @@ pub const VirtualMachine = struct { else => {}, } } else { + this.eventLoop().performGC(); this.waitForPromise(promise); } -- cgit v1.2.3