4
votes

I am learning about isolate in dart/flutter, in almost documents say that isolates don't share memory each other, but it not say how much maximum memory in an isolate. Is it limited by App maximum memory or each isolate have a separate memory space and doesn't depend on total initial memory allocated of Application?

Thank for any help.

Update

I found information at Dart Glossary: "Dart supports concurrent execution by way of isolates, which you can think of as processes without the overhead. Each isolate has its own memory and code, which can’t be affected by any other isolate"

1
Do you use isolate well now? Did you meet any issue with memory when using isolate? - hoangquyy

1 Answers

2
votes

See https://github.com/dart-lang/sdk/issues/34886

You can use --old_gen_heap_size to set the memory limit in megabytes.

You can specify such options by setting the environment variable like for example

DART_VM_OPTIONS="--old_gen_heap_size=2048 --observe"

The memory seems to be for the whole VM instance, not per isolate.

To get all available options use

dart --help --verbose

or

dart -h -v