Why doesn't my threaded .Net app scale linearly when allocating large amounts of memory?

前端 未结 5 2132
名媛妹妹
名媛妹妹 2021-01-05 06:06

I’ve run into something strange about the effect of large memory allocations on the scalability of the .Net runtime. In my test application I create lots of strings in a tig

5条回答
  •  天命终不由人
    2021-01-05 06:52

    You may want to look that this question of mine.

    I ran into a similar problem that was due to the fact that the CLR performs inter-thread synchronization when allocating memory to avoid overlapping allocations. Now, with the server GC, the locking algorithm may be different - but something along those same lines may be affecting your code.

提交回复
热议问题