这是indexloc提供的服务,不要输入任何密码
Skip to content

[ Memory ] Remove getIsolate polling in memory chart update logic #8209

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

Merged
merged 4 commits into from
Aug 19, 2024

Conversation

bkonyi
Copy link
Contributor

@bkonyi bkonyi commented Aug 19, 2024

Repeatedly calling getIsolate results in variables currently in scope in the top frame of the isolate at the time of the request being assigned object IDs, inserting them into the VM service's object ID ring buffer. This keeps the objects alive until the buffer wraps around, which can cause OOM exceptions if the target application is repeatedly making large, temporary allocations that would otherwise be GC'd.

The logic has been updated to rely on SentinelExceptions and the Isolate event stream to determine when an isolate is no longer relevant and should be removed from the memory chart statistics.

Fixes #8180

Repeatedly calling `getIsolate` results in variables currently in scope
in the top frame of the isolate at the time of the request being
assigned object IDs, inserting them into the VM service's object ID ring
buffer. This keeps the objects alive until the buffer wraps around,
which can cause OOM exceptions if the target application is repeatedly
making large, temporary allocations that would otherwise be GC'd.

The logic has been updated to rely on SentinelExceptions and the Isolate
event stream to determine when an isolate is no longer relevant and
should be removed from the memory chart statistics.

Fixes flutter#8180
@bkonyi bkonyi requested a review from kenzieschmoll as a code owner August 19, 2024 15:41
@kenzieschmoll
Copy link
Member

Also, please add a release note entry in NEXT_RELEASE_NOTES.md

@bkonyi bkonyi requested a review from a team as a code owner August 19, 2024 18:39
@bkonyi bkonyi requested review from elliette and removed request for a team August 19, 2024 18:39
@bkonyi bkonyi merged commit 74b8cb6 into flutter:master Aug 19, 2024
23 checks passed
@bkonyi bkonyi deleted the remove_get_isolate_polling_memory_chart branch August 19, 2024 20:26
kenzieschmoll pushed a commit that referenced this pull request Aug 27, 2024
…8209)

Repeatedly calling `getIsolate` results in variables currently in scope
in the top frame of the isolate at the time of the request being
assigned object IDs, inserting them into the VM service's object ID ring
buffer. This keeps the objects alive until the buffer wraps around,
which can cause OOM exceptions if the target application is repeatedly
making large, temporary allocations that would otherwise be GC'd.

The logic has been updated to rely on SentinelExceptions and the Isolate
event stream to determine when an isolate is no longer relevant and
should be removed from the memory chart statistics.

Fixes #8180
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Polling getIsolate(...) in the Memory Chart code can cause the VM to OOM
2 participants