isolateGroups property

bool isolateGroups
final

Each server isolate runs in its own isolate group, so it has its own heap and its own garbage collector. A pause of the GC in one isolate does not stop the others. Off: all isolates share one group.

Each isolate starts the app again from main(), so main() must be safe to run more than once, and code after startServer() runs in each isolate (use Dox().isPrimary to run it once). Migrator.migrate() is safe: it runs each migration one time. The command line arguments are not passed on, so read settings from the environment. The config, providers and routes are built by main() in each isolate.

It needs a file that the VM can start again: a dart build cli bundle on Linux, a file made with dart compile aot-snapshot (put it at <executable>.aot), or the script of dart run. When there is none, Dox logs one warning and runs as if the flag is off.

Turn it on only in production: with dart run the app starts slower and uses more memory with this flag.

Dox().compute has one pool per isolate. Dox().isolateId is right from the start of main(). CoreFlags.all() does not turn this flag on.

Implementation

// ponytail: a plain opt-in. Make it the default when it is proven in
// production.
final bool isolateGroups;