Memory Leak if pointer compression is enabled

42 views
Skip to first unread message

xinwei tang

unread,
Aug 28, 2025, 11:42:53 AM (10 days ago) Aug 28
to v8-dev
I found that when compiling V8 with Pointer Compression enabled but Sandbox disabled, the ExternalPointerTable only increases without decreasing, causing a memory leak. After a detailed investigation, I discovered that the garbage collection-related calls for the ExternalPointerTable are shielded by Sandbox-related macros. After enabling Sandbox, the leak is resolved, but the garbage collection of the ExternalPointerTable introduces approximately 100MB of peak memory usage and around 50MB of normal memory usage, which completely offsets the memory reduction brought by Pointer Compression. Is there a way to reduce the garbage collection overhead of the ExternalPointerTable or resolve the memory leak issue without enabling Sandbox?

Michael Lippautz

unread,
Aug 29, 2025, 4:26:58 AM (9 days ago) Aug 29
to v8-...@googlegroups.com
Can you file a bug on crbug.com for Blink>JavaScript>GarbageCollection with a repro and hints to the missing hooks?

This is probably a historic artifact of only using EPT in sandbox configurations. In order to avoid maintenance cost we have since made quite a few sandbox concepts also the default on non-sandbox builds. We should fix this.

-Michael

On Thu, Aug 28, 2025 at 5:42 PM xinwei tang <txw19...@gmail.com> wrote:
I found that when compiling V8 with Pointer Compression enabled but Sandbox disabled, the ExternalPointerTable only increases without decreasing, causing a memory leak. After a detailed investigation, I discovered that the garbage collection-related calls for the ExternalPointerTable are shielded by Sandbox-related macros. After enabling Sandbox, the leak is resolved, but the garbage collection of the ExternalPointerTable introduces approximately 100MB of peak memory usage and around 50MB of normal memory usage, which completely offsets the memory reduction brought by Pointer Compression. Is there a way to reduce the garbage collection overhead of the ExternalPointerTable or resolve the memory leak issue without enabling Sandbox?

--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/v8-dev/0aa213b4-38a6-459f-8302-563d69645374n%40googlegroups.com.

xinwei tang

unread,
Aug 30, 2025, 12:49:59 PM (8 days ago) Aug 30
to v8-...@googlegroups.com

Michael Lippautz <mlip...@chromium.org> 于2025年8月29日周五 16:26写道:
Reply all
Reply to author
Forward
0 new messages