Drop the per-task timing stats, give a summary only (#5897)
We were keeping around the Task struct (216 bytes) for every worker we ever created, even though we only keep a maximum of 6 workers per Capability. These Task structs accumulate and cause a space leak in programs that do lots of safe FFI calls; this patch frees the Task struct as soon as a worker exits. One reason we were keeping the Task structs around is because we print out per-Task timing stats in +RTS -s, but that isn't terribly useful. What is sometimes useful is knowing how *many* Tasks there were. So now I'm printing a single-line summary, this is for the program in TASKS: 2001 (1 bound, 31 peak workers (2000 total), using -N1) So although we created 2k tasks overall, there were only 31 workers active at any one time (which is exactly what we expect: the program makes 30 safe FFI calls concurrently). This also gives an indication of how many capabilities were being used, which is handy if you use +RTS -N without an explicit number. MERGED from commit 085c7fe5
Showing
- rts/RtsMain.c 1 addition, 2 deletionsrts/RtsMain.c
- rts/Stats.c 19 additions, 23 deletionsrts/Stats.c
- rts/Task.c 45 additions, 55 deletionsrts/Task.c
- rts/Task.h 7 additions, 23 deletionsrts/Task.h
- rts/posix/OSThreads.c 0 additions, 1 deletionrts/posix/OSThreads.c
- rts/sm/Compact.c 1 addition, 1 deletionrts/sm/Compact.c
Loading
Please register or sign in to comment