View Single Post
  #18  
Old November 6th 05, 10:27 AM
Jon Danniken
external usenet poster
 
Posts: n/a
Default How can I get Win98 to release memory when an application is closed?

Thank you, Jeff; I appreciate that you read my query and I also appreciate
your reality-based explanation as to what exactly is going in this this
case. The mechanism makes sense now, and I appreciate knowing this.

You asked about about the memory usage in a different case; here it is:

Start -- 30 Mb unused RAM
Open 20Mb file -- 10 Mb unused RAM
Close 20Mb. file -- 30 Mb unused RAM
Check Properties of 20Mb file -- 15 Mb. unused RAM
Close Properties -- *** no change in unused RAM ***
Open 20Mb. file -- 0Mb. unused RAM, 5 Mb Swap

I guess my question at this point would be asking how to turn *off* the
"optimization" of Windows to that it returns the
released memory to unused physical memory after checking the properties.
(Or maybe I should just stop checking properties lol).

While I appreciate that the optimizations are handy in most circumstances, I
would much rather wait a little bit for the application to load than have
what little memory I have taken up (IMHO) by the "optimization". This
machine is currently only doing a few specific tasks, so I am willing (and
would prefer) to accept this mode of operation.

Is this possible, and if so, how?

Thanks again,

Jon

"Jeff Richards" wrote:
There is a difference between released memory and unused physical memory.
The application is releasing memory when it ends. However, Windows does

not
mark all the released memory as unused physical memory, because it knows

the
contents (at least for some of it). Windows tries to track the contents of
as much memory as possible, because this improves performance. You can see
this if you start your application, close it, and start it again. The
second startup is faster. Although the program released its memory,

Windows
kept track of the contents and was therefore able to re-load the

application
faster.

Applications that fail to release their memory are a problem, but it is a


very rare problem. You need a much more sophisticated monitor than the one
you are using to find it. You don't want to force Windows to return the
released memory to unused physical memory because that will prevent it

from
performing the optimisations (when possible) while not providing any
performance improvement.

The example you have quoted is not a valid comparison. Instead, compare

the
physical memory and swap file usage after loading the large file for two
cases: one where you have done the prior properties enquiry, and the other
without doing it.


"Jon Danniken" wrote:
Okay, I'll try to spell this out more clearly for you guys.

When I boot into this machine, I have 30Mb of unused physical memory.

When I look at the "Properties" of a 20Mb .wav file, the unused physical
memory drops to 15Mb.

When I close the "Properties" windows, the unused physical memory stays

at
15Mb.

If I open 20Mb file (for instance, in SndRec32), the unused physical
memory
drops to 0, and a 5Mb page file is used.

xxxxxxxxxxxxxx

Hence my original question: How can I get Win98 to release memory after

an
application (or the Properties window) is closed?

Note: As I stated as the *first thing* in my original post, adding more
RAM
is not an option at the current time; please do not waste time by
belaboring
this point.