Bug 180593 - Web Inspector: Canvas recordings use a lot of memory and are never released
Summary: Web Inspector: Canvas recordings use a lot of memory and are never released
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Blocks: WebInspectorCanvasRecording
  Show dependency treegraph
Reported: 2017-12-08 11:37 PST by BJ Burg
Modified: 2017-12-08 16:02 PST (History)
4 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2017-12-08 11:37:52 PST
via Nelson Thachuk:

- Canvas Tab: high resource usage when recording/after completing recording

1. Launch Safari
2. Navigate to https://www.google.com/maps/place/Apple+Infinite+Loop/@37.3316756,-122.0323777,17z/data=!3m1!4b1!4m5!3m4!1s0x808fb5b6c4951d0f:0xb651414deb31e9fb!8m2!3d37.3316756!4d-122.030189
3. Show Web Inspector (⌥⌘I)
4. Click New Tab button
5. Select Canvas tab
6. Launch Activity Monitor
7. Filter by “Safari”
8. Return to Safari and record the Canvas
9. Interact with Google Maps (NOTE: the Web Content processes’ CPU usage spikes)
10. Wait for recording to finish (NOTE: the Web Content processes’ CPU usage returns to normal and Web Inspector’s processes’ Memory usage spikes)
11. Dismiss the recording or close the Canvas tab and wait 30 seconds

- Memory should be released

- Memory is not released until the Web Inspector process is killed
Comment 1 BJ Burg 2017-12-08 11:39:14 PST
Comment 2 BJ Burg 2017-12-08 11:41:34 PST
The resource usage is somewhat expected, though we should have some way to clear recordings from memory if we don't expect to ever see them again. I don't know in what cases this would make sense.

After navigating, clear if:
- User never opened the recording
- Canvas Tab is closed
- Web Inspector is closed

Preserve recording if:
- User has opened it at least once
- It is imported from file
- Relevant canvas has been deleted from DOM but page hasn't navigated