On 13 Feb 98 at 14:55, Joe Pearson wrote:
> Can someone explain memory leaks in non-programmer's terms? I
> understand that they are basically blocks or buffers requested by the
> application at start-up or while running, but not released when it
> closes.
>
> What I can't understand is why the operating system ... or a clever
> utility from one of those clever programmers out there ... can't simply
> identify bits if memory whose "owning" module has gone away and free
> them (without needing a re-boot).
>
> I'm seeing memory space like disk space, where clusters can be marked as
> in use but not part of any file. Is this just too simplistic?
Just a bit.
The problem is that some of the memory "used" by a program is
memory allocated on its behalf within the OS. The application
doesn't own it, the OS does.
Why doesn't the OS free that memory when the application it was
allocated for goes away? Because many OS memory objects can be
shared by multuiple applications, that's why. The objects cannot be
deleted/destroyed until every application that might use them has
been shut down.
Most Win32 OS objects are good about keeping track of how many
current references are still outstanding, and will be properly
deleted when that count reaches 0. Only *some* Win16 structures keep
that kind of track, and some of those have bugs. Generally the Win16
objects are not tracked by the OS and rely on applications to take
care of it, and some (mostly older...) applications don't bother.
David G
PCSOFT: http://nospin.com or [log in to unmask]
|