• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 816
  • 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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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