Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 732321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:07:41+00:00 2026-05-14T07:07:41+00:00

How do I calculate the private working set of memory using C#? I’m interested

  • 0

How do I calculate the private working set of memory using C#? I’m interested in producing roughly the same figures as taskmgr.exe.

I’m using the Process namespace and using methods/data like WorkingSet64 and PrivateMemorySize64, but these figures are off by 100MB or more at times.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:07:41+00:00Added an answer on May 14, 2026 at 7:07 am

    This is a highly variable number, you cannot calculate it. The Windows memory manager constantly swaps pages in and out of RAM. TaskMgr.exe gets it from a performance counter. You can get the same number like this:

    using System;
    using System.Diagnostics;
    
    class Program {
        static void Main(string[] args) {
            string prcName = Process.GetCurrentProcess().ProcessName;
            var counter = new PerformanceCounter("Process", "Working Set - Private", prcName);
            Console.WriteLine("{0}K", counter.RawValue / 1024);
            Console.ReadLine();
        }
    }
    

    Do beware that the number really doesn’t mean much, it will drop when other processes get started and compete for RAM.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to calculate the process time per thread. how do i do it.?
I'm currently working on an application where we receive private health information. One of
private void calculate() { x=Double.parseDouble(amount1.getText().toString()); y=Double.parseDouble(amount2.getText().toString()); a=Double.parseDouble(amount3.getText().toString()); z=(a*703)/(((x*12)+y)*((x*12)+y)); tt.setText(Double.toString(z)); } **This is what I
We are working with an in memory data grid (IMDG) and we have a
I'm currently working on a homework assignment where I need to set up a
I am working on optimizing for speed a method to calculate a triangle number
I'm using this code to calculate the average color of an image but this
I wrote this program to calculate very big numbers without using any BigInteger method.
I am trying to calculate number of users, cumulatively for the dellstore2 database. Looking
I'm trying to calculate the time it takes to receive all data from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.