Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manipulating memory usage? 2

Status
Not open for further replies.

djjd47130

Programmer
Nov 1, 2010
480
US
I'm looking for a simple way to be able to control the memory my application uses. Mainly, I'd like to know if this is a suitable approach - how much difference does it make on performance? I'm doing some graphical stuff, and could take quite some memory, and I'd like to control how much is available, to basically lock out other programs from using it. Of course I also need to take the amount available into consideration as well. I need like a setting more like "How much memory to leave available to other programs" instead of an option for "How much memory this program should use".


JD Solutions
 
I could have up to 500 image objects (bitmap, jpeg, png, etc.) with various sized images opened at once. Yeah. That'll require some management of some sort.


JD Solutions
 
I'll get you started from what I know. My thinking is that you may not have any control, because the Windows Memory Manager is involved.

For example, let's say you have 1GB of RAM, and your Delphi program wants to reserve 500MB of it. Windows will basically say "uh huh, ok, well I'll keep that in mind, you go ahead and use that 500MB, but until you do, I'm not doing anything". When you do fill up that 500MB, Windows may start shunting other programs' memory off to the paging file, or it may decide that those other programs are more important and start moving your 500MB off to the paging file.

Bottom line - you don't have any control, and there will always be enough memory. You can't tell Windows explicitly "my program is special so don't use any of the paging file for me, keep it all in RAM". If your program is aggressively using that memory, Windows will do what provides the best performance for the windows system.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top