Tips and tricks for .NET using ASP and VB code.

Get Current Memory Usage

Dim CurrentProcess As Process = Process.GetCurrentProcess()
Diagnostics.Debug.WriteLine("Memory Usage (Working Set): " & CurrentProcess.WorkingSet64.ToString("0,000") & " bytes - Virtual Memory Size (Private Bytes): " & CurrentProcess.PagedMemorySize64.ToString("0,000") & " bytes - Total Memory: " & GC.GetTotalMemory(True).ToString("0,000") & " bytes")

No comments:

Post a Comment

Search This Blog