[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


SetProcessWorkingSetSizeEx and the 'system' process CPU usage

Posted on 2009-02-16
Medium Priority
Last Modified: 2013-12-17
My application, when running in terminal server, takes about 80Mb of ram and more.
The server is 2003 standard 32bit with 2 DualCore CPU's and 4Gb.
I found a way to reduce the amount of working set used by my application with the SetProcessWorkingSetSizeEx method but the more users connecting to the terminal server I noticed that the 'system' process is using 25% of the CPU (100% of one core) after running this method to the level where it 'hurts ' the server performance.

BTW, after running the method, it reduces the size of the WS form 80Mb to 5Mb. Also, I'm running this method every 1 minute.

1. why is that process using the 'system' process?
2. is it possible to reduce the usage of this process?
3. if not, any other way to trim the memory of the application?

Question by:OrenRozen
LVL 41

Expert Comment

ID: 23715680
I'm not sure we can answer your question without knowing a bit more about your application... what does it do?
LVL 21

Accepted Solution

mastoo earned 1500 total points
ID: 23715821
I'll post the disclaimer that I haven't played in this realm so I'm just guessing but...

You're probably forcing garbage collection to cycle too frequently.  Assuming you're only working with managed memory I presume one could reduce the working set to force gc to run more frequently, keeping the memory footpring smaller but at the cost of a less efficient gc process.  You might use a memory profile tool to be sure you aren't leaking any managed objects, and then you could try tuning the working set size.  I presume as you gradually decrease the working set size you can use perfmon to watch the gc cycles and you'll see the gc frequency increase.  

Author Comment

ID: 23946257
partial solution given

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question