Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB limit itself to X CPU usage and ram usage

Posted on 2010-09-09
2
Medium Priority
?
447 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:
Corey Scheich earned 1000 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

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…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

650 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