According to this article , in a multiprocessor system there is no competition when several threads allocate memory at the same time:
Distributions without synchronization In a multiprocessor system, generation 0 of the managed heap is divided into several memory arenas using one arena for each thread. This allows you to create multiple distribution threads at the same time, so exclusive access to the heap is required.
EDIT: Hans Passant correctly pointed out that in order for this behavior to apply, the garbage collector must be forced into gcServer mode in the workstation environment. This is done by editing the app.config or web.config and providing the following parameters:
<configuration> <runtime> <gcServer enabled="true"/> </runtime> ... </configuration>
user1222021
source share