Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

How to get how much memory consumed by application

$
0
0

Hello,


I am using a WPF application which consuming more memory.

Is there any way to get exact memory information consumed by application ?

Actually I have used the below lines of code to get the memory information.

    Public Function MemoryUsage() As String
        Dim runningProcess As Process = Process.GetCurrentProcess()
        Return Math.Round((runningProcess.PagedMemorySize / (1024 * 1024)), 2) & " MB".ToString
    End Function

But while comparing with Task Manager or other memory profilers, the above lines given memory is not matching.

Please help me get the current memory consuming by application.


Thanks & Regards,
Naga Suersh D


Viewing all articles
Browse latest Browse all 8156

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>