gopalshankar / address-sanitizer

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

AsanThreadLocalMallocStorage is unnecessarily large #296

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
AsanThreadLocalMallocStorage is declared as large flat buffer of uptrs. It's 
then used as a placeholder for SizeClassAllocatorLocalCache.

The problem is that sizeof(SizeClassAllocatorLocalCache) is only 100K (26K on 
32-bit platforms) whereas sizeof(AsanThreadLocalMallocStorage) is 3M (1.5M on 
32-bit platforms).

This causes problems in apps with many "lightweight" threads. E.g. my app has 
250 threads with small 2M stacks so malloc storage with it's additional 1.5M 
per thread increase virtual memory consumption by 2x (from 500M to 1G).

I can cook a patch if all this sounds reasonable.

Original issue reported on code.google.com by tetra2...@gmail.com on 15 Apr 2014 at 1:00

GoogleCodeExporter commented 9 years ago
ah, that's mine... thanks for reminding. 

Original comment by konstant...@gmail.com on 15 Apr 2014 at 1:11

GoogleCodeExporter commented 9 years ago
http://llvm.org/viewvc/llvm-project?view=revision&revision=206280 should fix 
this. 
Thanks again for reminding. 

Original comment by konstant...@gmail.com on 15 Apr 2014 at 1:38