?
Solved

VB limit itself to X CPU usage and ram usage

Posted on 2010-09-09
2
Medium Priority
?
445 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 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

762 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