Exemplo n.º 1
0
 public static void DumpHeap()
 {
     if (CLRProfilerControl.isProcessIsUnderProfiler && !CLRProfilerControl.DumpHeap(60000U))
     {
         throw new Exception("Failure to\tdump heap");
     }
 }
Exemplo n.º 2
0
 public override void Execute()
 {
     GC.Collect(2);
     GC.WaitForPendingFinalizers();
     CLRProfilerControl.DumpHeap();
     CLRProfilerControl.LogWriteLine("GCDump-- App Shutdown");
     this.FinishExecution();
 }
Exemplo n.º 3
0
 public static void LogWriteLine(string format, params object[] args)
 {
     if (!CLRProfilerControl.isProcessIsUnderProfiler)
     {
         return;
     }
     CLRProfilerControl.LogComment(string.Format(format, args));
 }
Exemplo n.º 4
0
 public static void LogWriteLine(string comment)
 {
     if (!CLRProfilerControl.isProcessIsUnderProfiler)
     {
         return;
     }
     CLRProfilerControl.LogComment(comment);
     if (!(comment == CLRProfilerControl.killProcessMarker))
     {
         return;
     }
     Process.GetCurrentProcess().Kill();
 }
Exemplo n.º 5
0
 static CLRProfilerControl()
 {
     try
     {
         bool allocationLoggingActive = CLRProfilerControl.GetAllocationLoggingActive();
         CLRProfilerControl.SetAllocationLoggingActive(!allocationLoggingActive);
         CLRProfilerControl.isProcessIsUnderProfiler = allocationLoggingActive != CLRProfilerControl.GetAllocationLoggingActive();
         CLRProfilerControl.SetAllocationLoggingActive(allocationLoggingActive);
         CLRProfilerControl.killProcessMarker = Environment.GetEnvironmentVariable("OMV_KILLPROCESS_MARKER");
     }
     catch (DllNotFoundException ex)
     {
         throw new Exception("profilerObj.dll was not found");
     }
 }