Mita community #18 Memory Leaks

Preview:

DESCRIPTION

This presentation show brief cases when Memory Leaks in .Net could take place.

Citation preview

Memory Leaks

Yuriy Seniuk

Memory in .NET

• Stack

• Managed Heap

• Unmanaged Heap

Memory Leaks

• OutOfMemoryEcxeption

• Slow Execution

• Increasing of Memory Usage

How to detect leaks?

Memory Leaks

• StackOverflowException

Invocation of methods which needs large memory resources

Cyclic/Deep Invocation

• Leaks in Thread’s stack

Leaks in Stack Memory

Memory Leaks

• Invocation of unmanaged code

• Errors in finalize methods

• Dynamic creation of an assembly in memory

• XmlSerializer

Leaks in Unmanaged Heap

Memory Leaks

• Fragmentation of Large Memory Heap

• Root links

Events

Static Fields

• Midlife crisis

Leaks in Managed Heap

Memory Leaks

http://msdn.microsoft.com/ru-ru/magazine/cc163491.aspx

http://msdn.microsoft.com/library/ee787088.aspx

http://stackoverflow.com/questions/11711867/extremely-large-

objects-and-managed-heap-in-c-sharp

Used resources

Memory Leaks

Q/A

Thanks you all

Recommended