Skip to content

spawn many isolates: better errors if too many, scale up #2598

Closed
@sigmundch

Description

@sigmundch

I'm creating this bug to track progress on this issue:
 - we need to report better error messages when we can't create another isolate (e.g. an exception like 'TooManyIsolates')
 - we eventually want to scale to a larger number of isolates.


(original bug as reported in misc@)

I can only spawn 79 isolate, is there any bug in below code or any
limitation on dart vm ?

What steps will reproduce the problem?

run below script on Linux with latest dart SDK.

import('dart:isolate');

myfun() {
 port.receive( (msg, SendPort reply) {
   print("recieve: $msg");
   reply.send("received");
 });
}

void test() {

 SendPort port = spawnFunction( myfun );
 port.call("hello").then( (reply) {
   print(reply);
 });

}

main()
{

 var times = 80;

 Stopwatch w = new Stopwatch();
 w.start();

 for(int i=0; i<times; i++) {
   test();
 }
 w.stop();

 print("time used: ${w.elapsedInMs()}");

}

./runtime/vm/scavenger.cc:162: error: expected: space_ != NULL

155 Scavenger::Scavenger(Heap* heap, intptr_t max_capacity, uword
object_alignment)
156 : heap_(heap),
157 object_alignment_(object_alignment),
158 count_(0),
159 scavenging_(false) {
160 // Allocate the virtual memory for this scavenge heap.
161 space_ = VirtualMemory::Reserve(max_capacity);
162 ASSERT(space_ != NULL);

ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 20
file size (blocks, -f) unlimited
pending signals (-i) 16382
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

Metadata

Metadata

Assignees

No one assigned

    Labels

    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 relevanttype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions