Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently we limit the isolate pool size to 15 as we know 16 isolates would deadlock. However, it turns out on 32-bit Dart SDK it would deadlock with 8 isolates.
The issue is that in Dart SDK having more than
MaxMutatorThreadCount
number of isolates would deadlock the whole Dart VM:The number of
MaxMutatorThreadCount
is determined through the following logic:https://github.com/dart-lang/sdk/blob/3.0.5/runtime/bin/main_impl.cc#L1174-L1181
https://github.com/dart-lang/sdk/blob/3.0.5/runtime/vm/heap/scavenger.h#L121
https://github.com/dart-lang/sdk/blob/3.0.5/runtime/vm/heap/scavenger.h#L222-L231
For current Dart SDK:
16MB / 512KB / 4 = 8
32MB / 512KB / 4 = 16
Main isolate counts as one so the limit is really 7 for 32-bit and 15 for 64 bit.
Unfortunately, there is no programatic way to get
MaxMutatorThreadCount
from Dart code, so we can only hard code for whatever is the default today.