O'Reilly logo

Memory Dump Analysis Anthology, Volume 7 by Dmitry Vostokov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

High Contention (.NET CLR Monitors)

This is a high contention pattern variant where the contention is around a monitor object. For example, we have a distributed CPU spike (Volume 5, page 99) for some threads:

0:000> !runaway
 User Mode Time
  Thread       Time
   9:6ff4       0 days 0:07:39.019
  12:6b88       0 days 0:06:19.786
  11:6bf0       0 days 0:06:13.889
  10:6930       0 days 0:06:09.240
  16:3964       0 days 0:05:44.483
  17:6854       0 days 0:05:35.326
  13:668c       0 days 0:05:35.123
  14:5594       0 days 0:05:34.858
  15:7248       0 days 0:05:23.111
   2:c54        0 days 0:00:41.215
   4:1080       0 days 0:00:00.349
   7:10f0       0 days 0:00:00.302
   0:c3c        0 days 0:00:00.271
[...]

If we look at their stack traces we find them all blocked trying to enter a monitor, for example:

 0:000> ~*k [...] 12 Id: d50.6b88 Suspend: 0 Teb: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required