Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4d7824351be902ab08fe44c90ef06715895ae37a
https://github.com/WebKit/WebKit/commit/4d7824351be902ab08fe44c90ef06715895ae37a
Author: Kishore Sri Venkata Ganesh Bolisetty <[email protected]>
Date: 2026-09-10 (Thu, 10 Sep 2026)
Changed paths:
M Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp
Log Message:
-----------
GPU process leaks GPUConnectionToWebProcess because didClose() never clears
m_remoteGPUMap
https://bugs.webkit.org/show_bug.cgi?id=323734
rdar://185543414
Reviewed by Kimmo Kinnunen.
GPUConnectionToWebProcess::didClose() clears m_remoteRenderingBackendMap to
break the
cycle formed by RemoteRenderingBackend's strong ref back to the connection.
However
RemoteGPU, which lives in m_remoteGPUMap, also holds a strong ref to
RemoteRenderingBackend. m_remoteGPUMap is never cleared: its only removal path
is
releaseGPU(), reached from an explicit ReleaseRemoteGPU message that never
arrives when
the WebContent process simply exits, which is exactly the case didClose()
handles. So
clearing m_remoteRenderingBackendMap only drops the map's own reference, and
any backend
still held by a RemoteGPU stays alive.
Those surviving RemoteRenderingBackend objects are what drives the unbounded
growth.
Each holds a strong ref to RemoteSharedResourceCache, which owns a
per-connection
WebCore::IOSurfacePool, and ~IOSurfacePool() is the only thing that empties
that pool
outside of memory pressure. Every pooled "WebKit LayerBacking" IOSurface
therefore stays
allocated for the lifetime of the GPU process. Each backend also holds a strong
ref to
the GPUConnectionToWebProcess itself, so the whole connection and the rest of
its object
graph leak with it.
The fix is to clear m_remoteGPUMap in didClose(), before
m_remoteRenderingBackendMap, so
the backends are actually released when their map entry goes. RemoteGPU has the
same
stopListeningForIPC() teardown as the objects in the maps didClose() already
clears, so
ScopedActiveMessageReceiveQueue tears it down identically.
* Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::didClose):
Canonical link: https://commits.webkit.org/320867@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications