Solved

Reducing System Resources

Posted on 1999-01-08
5
216 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
[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
  • 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

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
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 …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

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