cwgreene / thread-sanitizer

Automatically exported from code.google.com/p/thread-sanitizer
0 stars 0 forks source link

Uses a lot of memory for each goroutine #89

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Running with several thousand goroutines without GORACE="history_size=0 
detect_deadlocks=0" consumes enough memory that the process crashes with 
failure to allocate memory via mmap.

linux/amd64

Original issue reported on code.google.com by anacrolix@gmail.com on 8 Feb 2015 at 1:21

GoogleCodeExporter commented 9 years ago
The current per-goroutine overhead with default setting of history_size is 680K.
With GORACE=history_size=0 it goes down to 455K.
I've landed a set of changes that bring it down to 222K. That's pretty much the 
limit. 128K is occupied by thread trace (16K 8 byte entries), 64K is occupied 
by thread vector clock (8K 8 byte entries). Plus some limited overhead for 
everything else (including Go runtime as well).
I need to integrate fresh tsan runtime into Go tree so that it actually takes 
effect.

Original comment by dvyu...@google.com on 13 Feb 2015 at 5:46

GoogleCodeExporter commented 9 years ago
FTR, I used the following program for tests:
http://play.golang.org/p/raXIeRPxQv

Original comment by dvyu...@google.com on 13 Feb 2015 at 5:47