[Am-info] Why does NT fail to release allocated memory?
Lewis A. Mettler
lmettler@lamlaw.com
Sat, 08 Jan 2000 20:36:23 -0800
Eric,
Eric Lee Green wrote:
>
> On Sat, 08 Jan 2000, Lewis A. Mettler wrote:
> > Eric Lee Green wrote:
> > > On Sat, 08 Jan 2000, Lewis A. Mettler wrote:
> > > > This is not necessarily the case. However, if NT does not release all
> > > > memory back to the available pool until program termination (regardless
> > > > if free() is called or not), NT is poorly designed and can no longer be
> > > > used.
> > >
> > > Note that Unix displays the exact same behavior. The "free()" call in most libc
> > > implementations merely puts the freed block of memory into an internal "free"
> > > list for use by future malloc() calls rather than return it to the operating
> > > system. This is due to efficiency -- most programs use a fairly constant amount
> > > of memory, and constantly calling the kernel to handle routine malloc/free
> > > would be ridiculously expensive.
> >
> > Maybe it is just the inability of NT to use the virtual memory as it
> > should.
>
> That may indeed be a problem. The fundamental design of Windows NT as
> described by Simon Cooke and others appears to require that some pieces of data
> be "locked" into memory rather than be allowed to be swapped in or out. I
> would ask, though, what service pack level you're running, and what
> applications you're talking about.
With 128 Mbs of RAM I doubt it is a memory lock in problem. Unless it
locks into memory that space allocated for application data structures
and it fails to release that lock when the structures are destroyed.
I believe the same affect existed with NT 3.51 (SR 5) and NT 4 (SR 3).
My own application often ran by itself and was written in Delphi. In
the effort to eliminate any link in my own code I tried completely
destroying data structures from time to time with no affect. It is
always possible my own code had a leak.
Of the commercial packages that generate the same problem I have not
been able to narrow down which application might be doing it. It could
be Navigator or it could be a screen saver that activates and pauses as
they do.
>
> Meanwhile, finding the location of your memory leak and detirmining whether it
> was the OS or whether it was a runtime library that both of your programs used
> would be an interesting question. Netscape Communicator on most Unix platforms
> leaks because they linked it against a buggy version of the Motif GUI library,
> for example. Without knowing even what computer language your program is
> written in, it'd be hard to pinpoint what the problem is, and whether this is a
> case of Microsoft deliberately putting stuff into their OS to make their own
> programs run better than possible competitors' programs.
If the means to reuse released memory is kept secret then no
non-Microsoft applications can be expected to give satisfactory service.
>
> GIven that most Microsoft applications are bloated memory-leaking
> monstrosities, I find it hard to believe, though :-(. If Microsoft had "rigged"
> the OS, it's likely that their software would be more reliable than the
> competition's -- which, in most cases, it is not. I can regularly get Word 97 to
> GPF if I play with tables, for example -- while I've *NEVER* gotten WordPerfect
> to die. Office has something like 80% market share, while WordPerfect Suite has
> a little over 10% market share. Quality, obviously, is not the reason here.
Of course a program with its own memory leaks would not be fixed no
matter what the OS did. But, my original concern is based upon prior
statements (not on this list) that Microsoft only guarantees that
released memory will be released for reuse after a program terminates.
>
> > In my own application, I have it self terminate and restart after an
> > appropriate period of time.
>
> This is what the Apache web server does on Unix, for much the same reason.
Sounds like more than one OS has a design defect.
If it simply a matter of performance, that task could be performed if
the system goes idle. And, of course an interactive system is idle
almost all of the time.
Thanks for the help. But, I guess the answer remains elusive.
--
Lewis A. Mettler, Esq.(Attorney and Software Developer)
lmettler@LAMLaw.com
http://www.lamlaw.com/ (detailed review of the Microsoft antitrust
trial)