Esempio n. 1
0
 public static void DumpHeap()
 {
     if (CLRProfilerControl.isProcessIsUnderProfiler && !CLRProfilerControl.DumpHeap(60000U))
     {
         throw new Exception("Failure to\tdump heap");
     }
 }
Esempio n. 2
0
 public override void Execute()
 {
     GC.Collect(2);
     GC.WaitForPendingFinalizers();
     CLRProfilerControl.DumpHeap();
     CLRProfilerControl.LogWriteLine("GCDump-- App Shutdown");
     this.FinishExecution();
 }
Esempio n. 3
0
 public static void LogWriteLine(string format, params object[] args)
 {
     if (!CLRProfilerControl.isProcessIsUnderProfiler)
     {
         return;
     }
     CLRProfilerControl.LogComment(string.Format(format, args));
 }
Esempio n. 4
0
 public static void LogWriteLine(string comment)
 {
     if (!CLRProfilerControl.isProcessIsUnderProfiler)
     {
         return;
     }
     CLRProfilerControl.LogComment(comment);
     if (!(comment == CLRProfilerControl.killProcessMarker))
     {
         return;
     }
     Process.GetCurrentProcess().Kill();
 }
Esempio 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");
     }
 }