Solved

VB limit itself to X CPU usage and ram usage

Posted on 2010-09-09
9
406 Views
Last Modified: 2012-06-27
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
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 12

Expert Comment

by:GMGenius
ID: 33637453
Open your project properties page, then select the compile tab
Click on Advanced Compile Options, you can select the Target CPU there
0
 
LVL 12

Expert Comment

by:GMGenius
ID: 33637463
In .NET 2008 you can also choose the framework
I dont know how you can limit the RAM usage though
0
 
LVL 30

Expert Comment

by:MlandaT
ID: 33642023
I am not sure why you want to do this, however, for CPU usage, have a look at Processor Affinity settings http://msdn.microsoft.com/en-us/library/system.diagnostics.process.processoraffinity%28v=VS.90%29.aspx

Am not sure if you can do this for RAM
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 30

Expert Comment

by:MlandaT
ID: 33642032
You may want to look at http://blogs.msdn.com/b/oldnewthing/archive/2005/03/21/399688.aspx which discusses various insights into what you are attempting to do (though mainly discourages it... almost)
0
 
LVL 12

Expert Comment

by:GMGenius
ID: 33642241
I have had to do this,
I had to set the Target CPU to x86 so when it was run on a 64 bit OS the underlying 32bit only DLL would work, without doing this the DLL failed to work
0
 
LVL 5

Expert Comment

by:andr_gin
ID: 33645699
Only setting a RAM usage maximum for an application will only prevent a crashing application from using all the RAM of the machine and the application will be terminated with an OutOfMemory exception. If you want to stay below a defined limit and keep your application running, the application itself has to handle things like caching of data in a way that it uses not more than a defined value and swap not frequentyl used data to a temporary file.
0
 

Author Comment

by:gb874554
ID: 33670866
What is the best way of setting a RAM usage maximum for an application? (in VB.net)
0
 
LVL 12

Accepted Solution

by:
GMGenius earned 500 total points
ID: 33672015
I dont believe you can, the only option is as mentioned above , you have to ensure you code your application carefully
 
I suggest you take a read here
http://msdn.microsoft.com/en-us/magazine/dd882521.aspx 
0
 

Author Closing Comment

by:gb874554
ID: 33774428
That is right, it seams it can not be done. Thanks anway.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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