TIP: Click on subject to list as thread! ANSI
echo: delphi
to: ALL
from: BRYAN SMITH
date: 1996-12-21 14:23:00
subject: Dynamic Memory Allocation

Maybe somebody can clear up my confusion.  I somehow got the impression that
in Delphi/Windows, unlike TP/DOS, any memory allocated dynamically with
GetMem() or New() is not automatically returned to the system when the
program exits.  In other words, in Delphi, you have to free it yourself with
FreeMem/Dispose.
A program I wrote recently builds a large tree structure with Getmem's and
New's.  I had not completed the shutdown code to walk the tree and release
the memory, when the customer demanded to see what the program looked like.
Wanting to warn him of the potential loss of Windows resources, I put in a
ShowMessage to list the MemAvail before and after the tree was built.
My expectation was that each time the program was run within one windows
session, the MemAvail would progressively decrease.  Surprise, I got
essentially the same numbers every time I ran the program.
Can somebody please explain what I have mis-understood ?
--- PPoint 2.00
---------------
* Origin: Kingston, Canada (1:249/109.11)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.