• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 813
  • Last Modified:

Get memory size from task manager?

Hi there

Wonder if you can help me?

I have a console app written in C#/2005, in Task manager I can see the console app being run, and as you know the task manager shows the Mem Usage. How do I get the mem usage value for that console application and store that as a variable?

1 Solution
try the following:

   long totalMem = GC.GetTotalMemory(false);

if the returned value is not equal to the one in TaskManager, don't be alarmed, this is the memory your application is actually using, but the GC and CLR might have more memory (pre) allocated.

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now