pastebin - collaborative debugging tool
kpaste.net RSS


Performance Info
Posted by Anonymous on Wed 28th Dec 2011 21:46
raw | new post

  1.             PERFORMANCE_INFO pi = new PERFORMANCE_INFO();
  2.             pi.cb = Marshal.SizeOf(pi);
  3.             GetPerformanceInfo(ref pi, pi.cb);
  4.             Int64 CommitAvailable = pi.CommitLimit.ToInt64() - pi.CommitTotal.ToInt64();
  5.             Int64 PhysicalUsed = pi.PhysicalTotal.ToInt64() - pi.PhysicalAvailable.ToInt64();
  6.             Int64 PageFileTotal = pi.CommitLimit.ToInt64() - pi.PhysicalTotal.ToInt64();
  7.             Console.WriteLine("Commit Max:     {0}", pi.CommitLimit);
  8.             Console.WriteLine("Commit Avail:   {0}", CommitAvailable);
  9.             Console.WriteLine("Commit Used:    {0}", pi.CommitTotal);
  10.             Console.WriteLine();
  11.             Console.WriteLine("Physical Max:   {0}", pi.PhysicalTotal);
  12.             Console.WriteLine("Physical Avail: {0}", pi.PhysicalAvailable);
  13.             Console.WriteLine("Physical Used:  {0}", PhysicalUsed);
  14.             Console.WriteLine();
  15.             Console.WriteLine("Pagefile Max:   {0}", PageFileTotal);
  16.             Console.WriteLine("Pagefile Avail: {0}", pi.CommitTotal.ToInt64() - PhysicalUsed);
  17.             Console.WriteLine("Pagefile Used:  {0}", PageFileTotal - (pi.CommitTotal.ToInt64() - PhysicalUsed));

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at