Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make memory pressure handler call deleteAllCode with PreventCollectionAndDeleteAllCode #10847

Conversation

heycam
Copy link
Contributor

@heycam heycam commented Mar 1, 2023

69098eb

Make memory pressure handler call deleteAllCode with PreventCollectionAndDeleteAllCode
https://bugs.webkit.org/show_bug.cgi?id=253133
<rdar://problem/106065668>

Reviewed by Mark Lam and Yusuke Suzuki.

The memory pressure handler currently calls
GCController::deleteAllCode(DeleteAllCodeIfNotCollecting), but it turns out we
hit the case of a collection being in progress moderately often. We already
do a bunch of blocky work here to get memory usage down, so let's change this
to PreventCollectionAndDeleteAllCode to guarantee we can drop all JIT code.

* Source/WebCore/page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):

Canonical link: https://commits.webkit.org/261061@main

ebcd2f5

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe   πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ›  gtk
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2   πŸ§ͺ api-mac   πŸ§ͺ gtk-wk2
  πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk1   πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk2
βœ… πŸ›  tv-sim   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch-sim

@heycam heycam requested a review from cdumez as a code owner March 1, 2023 03:46
@heycam heycam self-assigned this Mar 1, 2023
@heycam heycam added the WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore). label Mar 1, 2023
Copy link

@MenloDorian MenloDorian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me

Copy link
Member

@Constellation Constellation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me. This is always run under VM::whenIdle. So discarding CodeBlock is safe.

@heycam heycam force-pushed the delete-code-wait-for-collector branch from 395436d to ebcd2f5 Compare March 2, 2023 10:05
@heycam heycam added the merge-queue Applied to send a pull request to merge-queue label Mar 2, 2023
…nAndDeleteAllCode

https://bugs.webkit.org/show_bug.cgi?id=253133
<rdar://problem/106065668>

Reviewed by Mark Lam and Yusuke Suzuki.

The memory pressure handler currently calls
GCController::deleteAllCode(DeleteAllCodeIfNotCollecting), but it turns out we
hit the case of a collection being in progress moderately often. We already
do a bunch of blocky work here to get memory usage down, so let's change this
to PreventCollectionAndDeleteAllCode to guarantee we can drop all JIT code.

* Source/WebCore/page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):

Canonical link: https://commits.webkit.org/261061@main
@webkit-commit-queue
Copy link
Collaborator

Committed 261061@main (69098eb): https://commits.webkit.org/261061@main

Reviewed commits have been landed. Closing PR #10847 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 2, 2023
@webkit-early-warning-system webkit-early-warning-system merged commit 69098eb into WebKit:main Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore).
Projects
None yet
5 participants