BEWARE: f f g g entaation , GC.Collect() IDisposal , (LOH ~ 80kb +, ), (OOM) MB . , , , , , (80 kb) LOH, , parallelism - ( , , ), .
( - , - "% , , - .
System.Collections.Concurrent.ObjectPool beta1 ( , , , , , / ?), , Func < > Get/Put helper . , .
, .NET 4 .ToArray() , .ToArray(T target).
Getting support for using SOS / windbg (.loadby sos mscoreei for CLRv4) to analyze this class of problems can help. Thinking about this, the current garbage collection system is more like recycling garbage (using the same physical memory), ObjectPool is similar to garbage recycling. If someone remembers 3 Rs, reducing memory usage is also a good idea, for performance: wink
source
share