30.06.2013 Views

Under the Hood of .NET Memory Management - Simple Talk

Under the Hood of .NET Memory Management - Simple Talk

Under the Hood of .NET Memory Management - Simple Talk

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Workstation GC mode ................................................................................................... 64<br />

Server GC mode ............................................................................................................... 67<br />

Configuring <strong>the</strong> GC ........................................................................................................ 68<br />

Runtime GC Latency Control ............................................................................................. 69<br />

GC Notifications .................................................................................................................... 70<br />

Weak References ..................................................................................................................... 73<br />

<strong>Under</strong> <strong>the</strong> hood................................................................................................................ 74<br />

More on <strong>the</strong> LOH ...................................................................................................................75<br />

Object Pinning and GC Handles .........................................................................................76<br />

GC Handles .......................................................................................................................77<br />

Object pinning ..................................................................................................................77<br />

Problems with object pinning ....................................................................................... 78<br />

Summary ..................................................................................................................................78<br />

Section 2: Troubleshooting ..............................................80<br />

What's Coming Next ..................................................................... 81<br />

Language .................................................................................................................................. 81<br />

Best practices ..........................................................................................................................82<br />

Symptom flowcharts ............................................................................................................. 84<br />

Chapter 4: Common <strong>Memory</strong> Problems .......................................86<br />

Types ........................................................................................................................................87<br />

Value types ........................................................................................................................ 88<br />

Reference types ................................................................................................................90<br />

<strong>Memory</strong> Leaks.........................................................................................................................92<br />

Disposing <strong>of</strong> unmanaged resources ..............................................................................93<br />

<strong>Simple</strong> Value Types ............................................................................................................... 99<br />

Overflow checking .........................................................................................................101<br />

Strings .................................................................................................................................... 103<br />

Intern pool .......................................................................................................................105<br />

Concatenation ................................................................................................................107<br />

Structs ....................................................................................................................................109

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!