From 7ce2ea0d148a3a7c9ad0f156c8e08a2e6482265f Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Tue, 16 Sep 2014 00:45:29 -0400 Subject: [PATCH] stop spawning so many tasks in guide-tasks 1000 tasks * 2MiB stack size -> 2GiB of virtual memory On a 64-bit OS, a 32-bit executable has 4GiB available, but the kernel gets half of the available address space so the limit is 2GiB on 32-bit. Closes #17044 --- src/doc/guide-tasks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/guide-tasks.md b/src/doc/guide-tasks.md index 687f2a3a83343..a02dd5a1c7df8 100644 --- a/src/doc/guide-tasks.md +++ b/src/doc/guide-tasks.md @@ -235,7 +235,7 @@ fn partial_sum(start: uint) -> f64 { } fn main() { - let mut futures = Vec::from_fn(1000, |ind| Future::spawn( proc() { partial_sum(ind) })); + let mut futures = Vec::from_fn(200, |ind| Future::spawn( proc() { partial_sum(ind) })); let mut final_res = 0f64; for ft in futures.mut_iter() {