Skip to content

Dart VM isolates take about 35 MB of memory each #614

Closed
@whesse

Description

@whesse

Each isolate that is created seems to take about 35 MB of memory until it is closed and GCd. This affects the number of asynchronous file system or socket operations that can be created, since they are implemented with isolates (currently). This also means that no system with more than a couple hundred isolates can work.

This seems to be true on both the debug and release ia32 builds. The following code shows the resulting memory use. If port.close() is called, then the isolates are GCd and memory use stays below 100 MB.

class A extends Isolate {
  A() : super.light(); // or heavy, makes no difference.
  void main() { /* port.close();*/ }
}

main() {
  var a = new A();
  for (var j = 0; j < 100; ++j ) {
    a.spawn();
    print(j);
  }
}

Metadata

Metadata

Assignees

Labels

P3A lower priority bug or feature requestarea-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.closed-obsoleteClosed as the reported issue is no longer relevantlibrary-isolate

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions