4

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"

Khánh Vũ Đỗ
  • 895
  • 1
  • 7
  • 13

1 Answers1

2

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
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • Hi sir @Günter Zöchbauer, please check this https://stackoverflow.com/questions/58589261/is-there-memory-issue-with-isolate-in-flutter-app and this https://github.com/flutter/flutter/issues/43623. Help me solve the memory issue from isolate – hoangquyy Nov 04 '19 at 07:46
  • 1
    Is there a way to setup a different heap size per isolate? – Sergey Molchanovsky Oct 13 '22 at 09:11