Solved

Reducing System Resources

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
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 Month3 days, 15 hours left to enroll

630 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