Solved

VB limit itself to X CPU usage and ram usage

Posted on 2010-09-09
2
443 Views
Last Modified: 2012-05-10
Hello,

i would like to know how to have a VB.net software to limit itself to X CPU usage and ram usage. How can this be done?

Thanks
0
Comment
Question by:gb874554
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
Corey2 earned 500 total points
ID: 33642789
It really depends on the nature of the process.  I don't know of a way to tell an application to utilize no more than 30% CPU, but depending on what you are trying to accomplish by setting these limits you could use one of the following

Set low priority on the process so that other applications calls get run first

Process.GetCurrentProcess.PriorityClass = ProcessPriorityClass.BelowNormal
'default is normal

You can also strategically pause the process to lower cpu usage on long processes
System.Threading.Thread.CurrentThread.Sleep(50)'50 millisecond process sleep
0
 

Author Closing Comment

by:gb874554
ID: 33670806
Answerd most of what i neeed.
0

Featured Post

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

691 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