Solved

Amount of used resources.

Posted on 1998-12-21
2
134 Views
Last Modified: 2010-04-04
Hi there,

Does anybodyknow any technique (or maybe solution or something) on how to reduce amount of resources (System/GDI) used by application or component?  
Once again, I do not leak resources, everything being freed nicely when app is closed but amount of resources being used wkile app's working is quite big (and when running on Windows95/98 is big dangerously). Thanks.

p.s. I dont have much windowed controls created. It is rather bitmaps (GDI resources).
0
Comment
Question by:_art_
2 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 100 total points
ID: 1352351
_art_,

There are a couple of very effective things you can do:

1. Make sure you don't autocreate all your forms in the DPR (this is a real killer). Instead create the form where you need it (ie: just shift that line of code that creates the form from the DPR to the appropriate place in the code) and Release them as soon as you have done with them.

2. If after doing 1 above you are still having problems because of the bitmaps then you may need to look at some sort of caching strategy (delphi uses a number of caches to preserve GDI system resources - such as fonts and brushes) or a strategy that involves grabbing at least some of the bitmaps off disk only at the time you need them.

Cheers,

Raymond.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1352352
Raymond is right with the autocreation of forms.

About bitmaps: You should use TImageList (or something like that) instead of using single Bitmaps. Because each and every TBitmap (respectively TImage) consumes one handle, while all the images in one imageList comsume all together only one handle. And since the kind of resources you're talking about is in reality the percent of free handles, that's very important.

Regards, Madshi.
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

Suggested Solutions

Title # Comments Views Activity
Activex get website that activex running on 3 75
delphi exception 7 58
Printing problem 2 72
SUM 2 INTEGER ARRAYS INTO 1 10 59
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

21 Experts available now in Live!

Get 1:1 Help Now