Bug 240647 - IPC stream work queues lack autoreleasepools
Summary: IPC stream work queues lack autoreleasepools
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kimmo Kinnunen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-05-19 07:31 PDT by Kimmo Kinnunen
Modified: 2022-05-23 01:59 PDT (History)
4 users (show)

See Also:


Attachments
Patch (8.27 KB, patch)
2022-05-20 00:54 PDT, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff
Patch (8.57 KB, patch)
2022-05-20 11:24 PDT, Kimmo Kinnunen
kkinnunen: commit-queue+
Details | Formatted Diff | Diff
Patch (8.77 KB, patch)
2022-05-20 11:29 PDT, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kimmo Kinnunen 2022-05-19 07:31:31 PDT
IPC stream work queues lack autoreleasepools
Comment 1 Radar WebKit Bug Importer 2022-05-19 07:31:40 PDT
<rdar://problem/93575653>
Comment 2 Kimmo Kinnunen 2022-05-20 00:54:53 PDT
Created attachment 459610 [details]
Patch
Comment 3 Simon Fraser (smfr) 2022-05-20 10:26:15 PDT
Comment on attachment 459610 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=459610&action=review

> COMMIT_MESSAGE:8
> +Add the autorelease pool to each iteration of IPC stream message
> +processing.

Would be nice to explain what Obj-C objects were accumulating, and what kinds of pages benefit from this change.
Comment 4 Kimmo Kinnunen 2022-05-20 11:24:50 PDT
Created attachment 459622 [details]
Patch
Comment 5 Kimmo Kinnunen 2022-05-20 11:29:52 PDT
Created attachment 459623 [details]
Patch
Comment 6 Kimmo Kinnunen 2022-05-20 11:39:33 PDT
Added some explanation, unfortunately I don't have very solid data. 
I haven't seen any pages that would benefit from fixing the leaks, as shadowed by the orders of magnitude bigger problems.

The leaks are form of 
  12492 (1.77M) CONTENT:  NSDictionary  ObjC  CoreFoundation
      + 12492 (1.77M) _malloc_zone_calloc  (in libsystem_malloc.dylib) + 0  [0x1b7ae16c0]
      +   12492 (1.77M) class_createInstance  (in libobjc.A.dylib) + 64  [0x1be78aee8]
      +     12492 (1.77M) __CFAllocateObject  (in CoreFoundation) + 24  [0x1a5155e14]
      +       11757 (1.74M) __NSDictionaryI_new  (in CoreFoundation) + 144  [0x1a514e0f0]
      +       ! 11583 (1.70M) +[NSDictionary dictionaryWithObjects:forKeys:count:]  (in CoreFoundation) + 52  [0x1a519fb50]
      +       ! : 3463 (487K) WebCore::optionsForBiplanarSurface(WebCore::IntSize, unsigned int, unsigned long, unsigned long)  (in WebCore) + 332  [0x114109cb4]
      +       ! : | 3463 (487K) WebCore::IOSurface::IOSurface(WebCore::IntSize, WebCore::IntSize, WebCore::DestinationColorSpace const&, WebCore::IOSurface::Format, boo
l&)  (in WebCore) + 232  [0x11344df1c]
      +       ! : |   3463 (487K) WebCore::IOSurface::create(WebCore::IOSurfacePool*, WebCore::IntSize, WebCore::IntSize, WebCore::DestinationColorSpace const&, WebCore
::IOSurface::Format)  (in WebCore) + 92  [0x11344dce0]
      +       ! : |     3463 (487K) WebKit::ImageBufferShareableMappedIOSurfaceBackend::create(WebCore::ImageBufferBackend::Parameters const&, WebCore::ImageBuffer::Cre
ationContext const&)  (in WebKit) + 136  [0x1064dc4f0]
      +       ! : |       3463 (487K) WTF::RefPtr<WebKit::RemoteImageBuffer<WebKit::ImageBufferShareableMappedIOSurfaceBackend>, WTF::RawPtrTraits<WebKit::RemoteImageBu
ffer<WebKit::ImageBufferShareableMappedIOSurfaceBackend> >, WTF::DefaultRefDerefTraits<WebKit::RemoteImageBuffer<WebKit::ImageBufferShareableMappedIOSurfaceBackend> > >
 WebCore::ConcreteImageBuffer<WebKit::ImageBufferShareableMappedIOSurfaceBackend>::create<WebKit::RemoteImageBuffer<WebKit::ImageBufferShareableMappedIOSurfaceBackend>,
 WebKit::RemoteRenderingBackend&, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::RenderingResourceIdentifierType> >&>(WebCore::FloatSize const&, float, WebCor
e::DestinationColorSpace const&, WebCore::PixelFormat, WebCore::RenderingPurpose, WebCore::ImageBuffer::CreationContext const&, WebKit::RemoteRenderingBackend&, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::RenderingResourceIdentifierType> >&)  (in WebKit) + 104  [0x10617649c]
      +       ! : |         3463 (487K) WebKit::RemoteRenderingBackend::createImageBufferWithQualifiedIdentifier(WebCore::FloatSize const&, WebCore::RenderingMode, WebCore::RenderingPurpose, float, WebCore::DestinationColorSpace const&, WebCore::PixelFormat, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::RenderingResourceIdentifierType> >)  (in WebKit) + 80  [0x106173db4]

(this is result of intensive scrolling and then idling around)
Comment 7 EWS 2022-05-23 01:59:11 PDT
Committed r294628 (250854@main): <https://commits.webkit.org/250854@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 459623 [details].