0

In Java I need only to press a single key (ctrl-break) to see the stacktrace of a blocking finalizer.

Is there a simple solution to see this also in .NET which can understand a Java programmer?

Horcrux7
  • 23,758
  • 21
  • 98
  • 156
  • If you are debugging in visual studio, you can pause the execution and view the stack trace of any running thread. VS 2015 has additional diagnostics, and there is a concurrency visualizer plugin available for other VS versions that may show you what it is you are looking for (if it even matters in a .net context). – StingyJack Aug 25 '15 at 14:08

1 Answers1

1

may be you should pause ctrl+alt+break and look into a threads window ctrl+d, t for search blocking

burning_LEGION
  • 13,246
  • 8
  • 40
  • 52
  • Where should I press this keys? I can not see any effect. – Horcrux7 Aug 25 '15 at 14:51
  • Ok, you mean VS. My problem with VS is that it show only my threads. I can not see a finalizer thread. – Horcrux7 Aug 25 '15 at 14:59
  • @Horcrux7, you can change threads in `Treads window`. i've just double checked. I see `GC Finalizer Thread` also you can set a breakpoint. But finalizer'll call when gc starts colletion, you can forse it by `GC.Collect()` but it will not happen immediately – burning_LEGION Aug 25 '15 at 15:27
  • If I set a breakpoint in a destructor then I see the name `GC Finalizer Thread`. But if I stop on another location then I have a thread with no name and no location and the same priority highest. – Horcrux7 Aug 26 '15 at 12:43