Solved

Amount of used resources.

Posted on 1998-12-21
2
139 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_
[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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

752 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