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 8477531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:29:34+00:00 2026-06-10T18:29:34+00:00

I have an application that consist of multiple components, each compiled into single DLL,

  • 0

I have an application that consist of multiple components, each compiled into single DLL, each runs multiple thread within itself. I have a shell program that start up these components.

I am running this application on a window CE 6 environment and this is the only program (aside from those of system) on it. However, over time I see that the allocated memory usage slowly increasing when I look at the task manager window. Suspect my program may have a memory leak I do the following.

I go to a specific component and create a Timer object that runs every 30 minutes that calls the following code:

long memByte = GC.GetTotalMemory(false);
Console.Write("Heap Memory: " + (memByte/1000).ToString() + "KB");

From reading around the internet I think GetTotalMemory basically gives me the total manage memory of the system. If my program does not have a memory leak issue then I suspect overtime I would get some type of flat line when I graph out the result. Otherwise I will see a slow increase.

My question is, does GetTotalMemory actually gives me the total manage heap memory of all application or does it give only specific heap that is being used by the current component where this code is running from?

Thank you,

  • 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-06-10T18:29:36+00:00Added an answer on June 10, 2026 at 6:29 pm

    The task manager is showing you different info that GC.GetTotalMEmory. It’s quite possible to make an app that has a GC.GetTotalMemory that flat lines, but slowly runs the device out of memory and crashes.

    GC.GetTotalMemory is only looking at the GC heap, not at allocated virtual or physical memory. P/Invokes and native allocations outside the GCHeap are going to be transparent to the GC.GetTotalMemory call, which is why it’s a fairly useless call for trying to determine if you’re actually leaking.

    The GC Heap can grow and/or shrink at times without making any calls at all to the OS memory manager, in fact it’s pretty common for it to do so. The GC grabs large chunks at a time from the OS, then divides that into smaller blocks as the app requires GC heap memory.

    P/Invoke GlobalMemoryStatus if you want to track the actual OS allocation that you see ovr in the Control Panel of the device.

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

Sidebar

Related Questions

We have an enterpise web application that did consist of 4 compiled components (DLLs).
I have a server application that consists of multiple OSGi bundles, some mine, some
I have an application consists of a single EXE and multiple DLLs. After reading
I have an application consist of various dll and one exe. In exe we
I have an application that consists of multiple python scripts. Some of these scripts
I have a WPF application that consists of multiple projects that have forms, classes,
I have an application that consists of two processes (let's call them A and
I have an application that consists of two forms. One form displays data returned
I have an asp.net 4.0 framework application that consists of a Masterpage and contentplaceholders.
I would like to have a custom view in my application that consists of

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.