Mita community #18 Memory Leaks

8
Memory Leaks Yuriy Seniuk

description

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

Transcript of Mita community #18 Memory Leaks

Page 1: Mita community #18 Memory Leaks

Memory Leaks

Yuriy Seniuk

Page 2: Mita community #18 Memory Leaks

Memory in .NET

• Stack

• Managed Heap

• Unmanaged Heap

Memory Leaks

Page 3: Mita community #18 Memory Leaks

• OutOfMemoryEcxeption

• Slow Execution

• Increasing of Memory Usage

How to detect leaks?

Memory Leaks

Page 4: Mita community #18 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

Page 5: Mita community #18 Memory Leaks

• Invocation of unmanaged code

• Errors in finalize methods

• Dynamic creation of an assembly in memory

• XmlSerializer

Leaks in Unmanaged Heap

Memory Leaks

Page 6: Mita community #18 Memory Leaks

• Fragmentation of Large Memory Heap

• Root links

Events

Static Fields

• Midlife crisis

Leaks in Managed Heap

Memory Leaks

Page 7: Mita community #18 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

Page 8: Mita community #18 Memory Leaks

Q/A

Thanks you all