View Single Post
  #37  
Old November 9th 05, 09:12 AM posted to microsoft.public.win98.gen_discussion,microsoft.public.win98.performance
Jeff Richards
External Usenet User
 
Posts: 1,526
Default How can I get Win98 to release memory when an application is closed?

To test your problem, the procedure would be:
1.
Start
Open 20Mb file
Check memory usage
2.
Start
Check Properties of 20Mb file
Open 20Mb file
Check memory usage

The important thing is memory available when you are trying to process that
file - at any other time you really don't care how memory is being used.

But it is impossible to draw sensible conclusions from the simple type of
memory analysis you are using. For instance, you might see an increase in
swap file used between the two scenarios. But whether or not this is
significant for performance depends of why the swap file usage has changed.
As I mentioned, simply looking at free or unallocated RAM tells you nearly
nothing about how Windows is using memory and whether or not performance is
being affected.

The optimization that Windows can achieve does not take up any memory. It's
no quicker to write over free memory than it is to write over memory where
Windows was saving the contents in case it might be re-used but has now
decided that there's a more important use for it. That's the critical
point - the process of discarding memory involves no processing overhead.
Memory that can be returned to the unallocated pool (freed, in terms of your
original question) is exactly the same memory that gets written over just as
soon as there's a more important use for it.

If you want to force Windows to return memory to the unallocated pool there
are any number of utilities that claim to defragment or reclaim memory. They
don't do anything useful, but they do change the measurements reported by
these memory monitors. People with plenty of experience with Windows will
almost always advise (for W98 or later) to just let Windows look after it.
If you choose to use one of these utilities, be very careful it does not
come with a trojan - this sort of software is a popular choice for people
who need to install something secret on your system.
--
Jeff Richards
MS MVP (Windows - Shell/User)
"Jon Danniken" wrote in message
...
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