Solved

Amount of used resources.

Posted on 1998-12-21
2
140 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month7 days, 17 hours left to enroll

617 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