Board index » delphi » A free tip to make your app use about 1meg less memory!

A free tip to make your app use about 1meg less memory!

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.

----------------------------------------------------------------------------
----------------------------------------------------------
Dan Pinder
Galaxy Software - Taking the Internet to the Max
http://www.pagesrus.com/galaxy
gal...@sprint.ca

 

Re:A free tip to make your app use about 1meg less memory!


Dan -

Quote
>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.

I must not have done whatever you were doing to get OLEAUT32 to load.  I added
the line above to my application, and the runtime memory size (according to the
NT 4.0 task list) went from 5656 before to 5664 after.  Not a significant change
(not to mention it was in the wrong direction).

--
Clayton Neff
Software Project Leader
The Personal Marketing Company, Inc.
11843 West 83rd Terrace
Lenexa, KS  66214
(913)492-0322
clay...@tpmco.com

Re:A free tip to make your app use about 1meg less memory!


Quote
Dan Pinder wrote:
> 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.

Two things to consider:

1) Your app might not be using OLE in the first place.
2) Another app might be.

--
Martin Brooks - Systems Administrator
=====================================
Image Data Systems (UK) Ltd
82-84 Clerkenwell Road
London
EC1M 5RJ

  T: 0171 336 7942
  F: 0171 336 7943
  E: martin(at)image-data(dot)com
UIN: 2178117

* abuse@localhost postmaster@localhost root@localhost *

- Computers make very fast, very accurate mistaks -

Re:A free tip to make your app use about 1meg less memory!


Clayton,

    That's odd, it seemed to work form me in Windows95. I can't imagine how
unloading a DLL would encrease memory usage. But anyway, I found that tip on
the internet, and thought it would be a nice thing to share.

Dan Pinder
Galaxy Software - Taking the Internet to the Max
http://www.pagesrus.com/galaxy
gal...@sprint.ca

Quote
>Clayton Neff wrote in message <34476473.2335...@news.primenet.com>...
>I must not have done whatever you were doing to get OLEAUT32 to load.  I
added
>the line above to my application, and the runtime memory size (according to
the
>NT 4.0 task list) went from 5656 before to 5664 after.  Not a significant
change
>(not to mention it was in the wrong direction).

Re:A free tip to make your app use about 1meg less memory!


Martin,
        Good point, if another application was using OLE, it would remain
loaded.

Quote
Martin Brooks wrote in message <34478F3B.4C815...@in.signature.com>...
>Two things to consider:

>1) Your app might not be using OLE in the first place.
>2) Another app might be.

Other Threads