Solved

Reducing System Resources

Posted on 1999-01-08
5
212 Views
Last Modified: 2010-04-06
My program uses a lot of resources, I using Delphi 3.

I want someone to provide to me, efficient tips for reducing the resources that a Delphi application needs (most, the better)
0
Comment
Question by:HarisIV
  • 3
5 Comments
 

Expert Comment

by:ptiemann2
ID: 1355310
A good way to cut down on the amount of memory used,
assuming your program does not use OLE, is to free a DLL:

 FreeLibrary(GetModuleHandle('OleAut32'));

This unloads OleAut32.dll and OLE32.dll, and can make your
program use about one megabyte less memory of RAM.

taken from http://www.preview.org/q/q2012.shtml

0
 
LVL 20

Expert Comment

by:Madshi
ID: 1355311
Which resources do you mean?
Just general memory consumation or this 90% system, GDI and user resources already known from win3.11?

If you mean the system, GDI and user resources, you should listen to this:
Each and every TBitmap/TIcon/TImage you use, consumes one handle. And Windows (win95, too) can only handle a restricted amount of handles. The %-resources show you how many percent of the handles are not used yet.
So if this is your problem, you should first of all look at TImageList. This is a bitmap/icon container, in which you can put all images/icons that have the same size and color depth. And every TImageList consumes only one handle. So this is probably the most important thing you can do.
Then, if your application has a lot of forms, you should think about creating them only if needed. Normally Delphi created all forms when the program starts. They are hidden, but consume a lot of handles. If you don't let Delphi create them at the program start, but if you create them yourself only if you need them (and free them afterwards), you'll save a lot of resources, too. If you don't know how to do this, ask me...

Does this help?

Regards, Madshi.
0
 

Accepted Solution

by:
mjustin earned 250 total points
ID: 1355312

- create forms at runtime if possible and free them after use (this also will increase startup speed!)

- if your users run more than one Delphi application, use the Package technology (<100 KB exe Size are possible!)
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1355313
Hey, mjustin, do you really think, your answer is better than my comment???????
HarisIV, please decide, if you like my comment more than mjustin's answer, then please reject his answer...
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1355314
G#+*'&%$#@'##   I hate it...  :-(((
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 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

13 Experts available now in Live!

Get 1:1 Help Now