Solved

Reducing System Resources

Posted on 1999-01-08
5
210 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

11 Experts available now in Live!

Get 1:1 Help Now