Solved

VB limit itself to X CPU usage and ram usage

Posted on 2010-09-09
9
400 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
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 12

Expert Comment

by:GMGenius
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 30

Expert Comment

by:MlandaT
Comment Utility
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 12

Expert Comment

by:GMGenius
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
That is right, it seams it can not be done. Thanks anway.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now