What causes memory fragmentation in .NET

Posted by Matt on Stack Overflow See other posts from Stack Overflow or by Matt
Published on 2011-03-09T03:07:55Z Indexed on 2011/03/09 16:10 UTC
Read the original article Hit count: 312

I am using Red Gates ANTS memory profiler to debug a memory leak. It keeps warning me that:

Memory Fragmentation may be causing .NET to reserver too much free memory.

or

Memory Fragmentation is affecting the size of the largest object that can be allocated

Because I have OCD, this problem must be resolved.

What are some standard coding practices that help avoid memory fragmentation. Can you defragment it through some .NET methods? Would it even help?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET