Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.
VB.Net: Getting memoryusage of one process
From Wiki
- Public Shared Function GetMemoryUsage(ByVal ProcessName As String) As String
- Dim _Process As Process = Nothing
- Dim _Return As String = ""
- For Each _Process In Process.GetProcessesByName(ProcessName)
- If _Process.ToString.Remove(0, 27).ToLower = "(" & ProcessName.ToLower & ")" Then
- _Return = (_Process.WorkingSet64 / 1024).ToString("0,000") & " K"
- End If
- Next
- If Not _Process Is Nothing Then
- _Process.Dispose()
- _Process = Nothing
- End If
- Return _Return
- End Function
You will have to pass it the name of the process for which you want to have the memoryusage. It is the same name as shown by the task manager in the tab Processes in the Image name column.



LTD Social Sitings
Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.