[Update - September 30, 2010]
Since I studied a lot of this and related topics, I will write all the tips that I have gathered from my experience and the suggestions presented in the answers here -
1) Use a memory profiler (try the CLR Profiler to get started) and find routines that consume max mem and fine-tune them, such as reusing large arrays, try to maintain minimal object references.
2) If possible, allocate small objects (less than 85k for .NET 2.0) and use memory pools if you can avoid using a large amount of processor by the garbage collector.
3) If you increase links to objects, you are responsible for removing links to them as many times. You will have peace of mind and the code will probably work better.
4) If nothing works and you are still clueless, use the exception method (comment / skip code) to find out what consumes most of the memory.
Using memory performance counters inside your code can also help you.
Hope this help!
[Original question]
Hello!
I am working in C # and my problem has an exception in memory.
I read an excellent article on LOH here → http://www.simple-talk.com/dotnet/.net-framework/the-dangers-of-the-large-object-heap/
Amazing to read!
A,
http://dotnetdebug.net/2005/06/30/perfmon-your-debugging-buddy/
My problem:
. ( WinDBG !), .
CLR . :
, , CLR Profiler Performance Counters ( ), :
:
:
(, ) (, , ), GC.Collect, . , 500 ( :-() .
, - ,.NET GC OOM.
, 85 LOH? ? .
, OOM?
,
3.
Memory Leaks Indicators:
# bytes in all Heaps increasing
Gen 2 Heap Size increasing
# GC handles increasing
# of Pinned Objects increasing
# total committed Bytes increasing
# total reserved Bytes increasing
Large Object Heap increasing
:
- 4- 32- Wink 2K3 SP2 .
- , <= 2
- ( ) .
OOM, , .
! , - !