I have an application consisting of several components, each of which is compiled into one DLL, each of which executes several threads inside itself. I have a shell program that runs these components.
I run this application in a CE 6 window environment, and this is the only program (except the system one) on it. However, over time, I see that the allocated memory usage is slowly increasing when I look at the task manager window. I suspect that 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, which calls the following code:
long memByte = GC.GetTotalMemory(false); Console.Write("Heap Memory: " + (memByte/1000).ToString() + "KB");
From reading on the internet, I think GetTotalMemory basically gives me the total system management memory. If my program does not have a memory leak problem, I suspect that overtime I get some type of flat line when I calculate the result. Otherwise, I will see a slow increase.
My question is: does GetTotalMemory really give me the shared memory of the heap of the entire application, or gives only the specific heap that is used by the current component, where does this code work?
Thanks,
Fylix source share