DLLs resident in memory



juliadream
07-10-2005, 12:27 AM
One thing I could never understand about Windows XP (as opposed to Unix) is
that, even when I close ALL applications, not all the memory is returned
back to the system. Recently I read that when a Windows application is
closed, some of the associated DLLs remain in memory (so that the
application can re-launch faster the next time). This would certainly
explain the memory issue.

How would I be able to see all the DLLs in memory? The Task Manager only
shows me applications and processes.

More importantly, how do I identify and kill the DLLs associated with the
applications in question?

Rick \Nutcase\ Rogers
07-10-2005, 12:27 AM
Hi,

Basically, you have to flush the memory cache, but Windows will do this
automatically if the ram is needed elsewhere. Part of the memory management
design is to find use for as much of the available ram as possible, even if
it's only for caching. This does not inhibit operation in any way.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP
http://mvp.support.microsoft.com/
Associate Expert - WindowsXP Expert Zone
www.microsoft.com/windowsxp/expertzone
Windows help - www.rickrogers.org

"juliadream" <juliadream@psych.net> wrote in message
news:uWP9FrNWFHA.2700@TK2MSFTNGP12.phx.gbl...
> One thing I could never understand about Windows XP (as opposed to Unix)
> is that, even when I close ALL applications, not all the memory is
> returned back to the system. Recently I read that when a Windows
> application is closed, some of the associated DLLs remain in memory (so
> that the application can re-launch faster the next time). This would
> certainly explain the memory issue.
>
> How would I be able to see all the DLLs in memory? The Task Manager only
> shows me applications and processes.
>
> More importantly, how do I identify and kill the DLLs associated with the
> applications in question?
>

Malke
07-10-2005, 12:28 AM
juliadream wrote:

> One thing I could never understand about Windows XP (as opposed to
> Unix) is that, even when I close ALL applications, not all the memory
> is returned
> back to the system. Recently I read that when a Windows application
> is closed, some of the associated DLLs remain in memory (so that the
> application can re-launch faster the next time). This would certainly
> explain the memory issue.
>
> How would I be able to see all the DLLs in memory? The Task Manager
> only shows me applications and processes.
>
> More importantly, how do I identify and kill the DLLs associated with
> the applications in question?

You could look at one of the free process explorer type tools from
Systernals. But why are you bothered about this? Are you having a
problem? When you close out of a program in a *nix system, there are
still lots of processes going on in the background, libraries, etc. Do
a ps axu to see. Or run top. If you are having problems with a Windows
system, please post back with details of the problem and the system so
we can help you.

Malke
--
MS-MVP Windows User/Shell
Elephant Boy Computers
www.elephantboycomputers.com
"Don't Panic"

Ken Blake
07-10-2005, 12:28 AM
In news:uWP9FrNWFHA.2700@TK2MSFTNGP12.phx.gbl,
juliadream <juliadream@psych.net> typed:

> One thing I could never understand about Windows XP (as opposed
> to
> Unix) is that, even when I close ALL applications, not all the
> memory
> is returned back to the system. Recently I read that when a
> Windows
> application is closed, some of the associated DLLs remain in
> memory
> (so that the application can re-launch faster the next time).
> This
> would certainly explain the memory issue.


Yes, but this isn't a problem. It helps you, but doesn't hurt. If
the memory is subsequently needed by other apps, it will
automatically be released for them.


> How would I be able to see all the DLLs in memory? The Task
> Manager
> only shows me applications and processes.
>
> More importantly, how do I identify and kill the DLLs
> associated with
> the applications in question?


No need to do this. It works well, and you shouldn't interfere
with it.

--
Ken Blake - Microsoft MVP Windows: Shell/User
Please reply to the newsgroup

juliadream
07-10-2005, 12:28 AM
"Malke" <notreally@invalid.com> wrote in message
news:uEJ13YOWFHA.3864@TK2MSFTNGP10.phx.gbl...

> You could look at one of the free process explorer type tools from
> Systernals. But why are you bothered about this? Are you having a
> problem? When you close out of a program in a *nix system, there are
> still lots of processes going on in the background, libraries, etc. Do
> a ps axu to see. Or run top. If you are having problems with a Windows
> system, please post back with details of the problem and the system so
> we can help you.


Certainly. Here are the details. The scenario is the same for Windows XP
(which I use at home) and Windows 2K (which I use at work). Both machines
have 512MB of RAM. Once I run a few compute-intensive applications
simultaneously, both systems become (understandably) slow and unresponsive.
Common sense would dictate that if I were to close all these applications,
the Windows systems would become as fast and responsive as they were before
I launched the applications. Unfortunately, that' not the case. I usually
end up having to reboot the machines to get optimal performance back.

Task Manager is giving me no clues. If it's not the resident DLLs, then
what could it be?

Malke
07-10-2005, 12:28 AM
juliadream wrote:

>
> "Malke" <notreally@invalid.com> wrote in message
> news:uEJ13YOWFHA.3864@TK2MSFTNGP10.phx.gbl...
>
>> You could look at one of the free process explorer type tools from
>> Systernals. But why are you bothered about this? Are you having a
>> problem? When you close out of a program in a *nix system, there are
>> still lots of processes going on in the background, libraries, etc.
>> Do a ps axu to see. Or run top. If you are having problems with a
>> Windows system, please post back with details of the problem and the
>> system so we can help you.
>
>
> Certainly. Here are the details. The scenario is the same for
> Windows XP
> (which I use at home) and Windows 2K (which I use at work). Both
> machines
> have 512MB of RAM. Once I run a few compute-intensive applications
> simultaneously, both systems become (understandably) slow and
> unresponsive. Common sense would dictate that if I were to close all
> these applications, the Windows systems would become as fast and
> responsive as they were before
> I launched the applications. Unfortunately, that' not the case. I
> usually end up having to reboot the machines to get optimal
> performance back.
>
> Task Manager is giving me no clues. If it's not the resident DLLs,
> then what could it be?

You could be having problems with these "compute-intensive (sic)"
programs for many reasons - what are the programs? Perhaps they require
more than 512MB of RAM. Perhaps they are badly coded. Perhaps your
processors are too slow. Perhaps your hard drives are slow or full.
Perhaps you have too many extraneous programs/processes running in the
background. Perhaps you have viruses and/or malware sucking up your cpu
cycles.

There isn't any way for me to tell from the information you've provided.
Did these machines perform well with these particular programs before?
If so, what changed?

In the meantime, aside from doing the normal maintenance (disk cleanup,
defrag, etc.) and troubleshooting for malware - try some clean boot
testing:

Clean Boot - http://support.microsoft.com/default.aspx?kbid=310353
and How to Troubleshoot By Using the Msconfig Utility in Windows XP -
http://support.microsoft.com/?id=310560

Malke
--
MS-MVP Windows User/Shell
Elephant Boy Computers
www.elephantboycomputers.com
"Don't Panic"

NoMoreMrNiceGuy
07-10-2005, 12:28 AM
juliadream wrote:
> One thing I could never understand about Windows XP (as opposed to Unix) is
> that, even when I close ALL applications, not all the memory is returned
> back to the system. Recently I read that when a Windows application is
> closed, some of the associated DLLs remain in memory (so that the
> application can re-launch faster the next time). This would certainly
> explain the memory issue.
>
> How would I be able to see all the DLLs in memory? The Task Manager only
> shows me applications and processes.
>
> More importantly, how do I identify and kill the DLLs associated with the
> applications in question?

I think there is a registry key which instructs the system to unload
dlls when the application is closed.....at least there was for Win 2000.
Sorry I can't remember the name or location. Maybe someone else can

Norm

HeyBub
07-10-2005, 12:28 AM
juliadream wrote:
> One thing I could never understand about Windows XP (as opposed to
> Unix) is that, even when I close ALL applications, not all the memory
> is returned back to the system. Recently I read that when a Windows
> application is closed, some of the associated DLLs remain in memory
> (so that the application can re-launch faster the next time). This
> would certainly explain the memory issue.
>
> How would I be able to see all the DLLs in memory? The Task Manager
> only shows me applications and processes.
>
> More importantly, how do I identify and kill the DLLs associated with
> the applications in question?

Assume X.DLL remains in memory after completing its chores. One of two
things will ultimately happen:

1. X.DLL will be needed again, in which case you save the time it would take
to fetch it from disk, or
2. Some other task needs the memory, in which case X.DLL will be
over-written and you'll save nothing.

So, in one case, you save a few milliseconds. In the other case, there's no
gain or loss.

Look, there's always SOMETHING in memory (even if only zeros). Why not have
something potentially useful?

DevilsPGD
07-10-2005, 12:28 AM
In message <uWP9FrNWFHA.2700@TK2MSFTNGP12.phx.gbl> "juliadream"
<juliadream@psych.net> wrote:

>One thing I could never understand about Windows XP (as opposed to Unix) is
>that, even when I close ALL applications, not all the memory is returned
>back to the system. Recently I read that when a Windows application is
>closed, some of the associated DLLs remain in memory (so that the
>application can re-launch faster the next time). This would certainly
>explain the memory issue.

What memory issue?

In the same way memory can be paged to disk, data from the disk can be
paged into memory. The is similar (Although not quite the same) as disk
caching.

It's harmless, if you actually need the RAM for anything (including the
disk cache) it will be released, but otherwise it's no more wasted then
if it was empty.


--
Prayer has no place in the public schools, just like facts
have no place in organized religion.
-- Superintendent Chalmers

DevilsPGD
07-10-2005, 12:28 AM
In message <OAxl$LPWFHA.1508@tk2msftngp13.phx.gbl> "juliadream"
<juliadream@psych.net> wrote:

>
>"Malke" <notreally@invalid.com> wrote in message
>news:uEJ13YOWFHA.3864@TK2MSFTNGP10.phx.gbl...
>
>> You could look at one of the free process explorer type tools from
>> Systernals. But why are you bothered about this? Are you having a
>> problem? When you close out of a program in a *nix system, there are
>> still lots of processes going on in the background, libraries, etc. Do
>> a ps axu to see. Or run top. If you are having problems with a Windows
>> system, please post back with details of the problem and the system so
>> we can help you.
>
>
>Certainly. Here are the details. The scenario is the same for Windows XP
>(which I use at home) and Windows 2K (which I use at work). Both machines
>have 512MB of RAM. Once I run a few compute-intensive applications
>simultaneously, both systems become (understandably) slow and unresponsive.
>Common sense would dictate that if I were to close all these applications,
>the Windows systems would become as fast and responsive as they were before
>I launched the applications. Unfortunately, that' not the case. I usually
>end up having to reboot the machines to get optimal performance back.

Chances are what has happened is that the needed program data has been
swapped out, the slowdown is waiting for the data to be swapped back.


--
Prayer has no place in the public schools, just like facts
have no place in organized religion.
-- Superintendent Chalmers

David Candy
07-10-2005, 12:28 AM
There are many things you could be talking about.

cmd /k tasklist /m

Note system dlls appear in memory multiple times but aren't (unless your program has done something wrong). Windows is a demand load system. This means it gets the desktop up as quickly as possible and delays loading many components that are to be permanently in memory until first use. Fonts are an example.

Explorer always leaves third party dlls in memory for a few minutes after use (if you right click one file then it is likely you'll do a second).

Also there is a file cache. If a file is required again it is in the cache. It is excuted from the cache.

Even if what you think is true was (it isn't) your conclusions are still irrelevent. If it's not used it will be swapped out. As it's a dll then it is swapped to the dll file, that is windows dumps it from memory (doesn't need to write as dll files don't change) as it knows it can reload it from the dll file.

As the program told windows to load the file, the program expects to be able to jump to that memory address - it won't check as it checked when it told windows to load the dll file. So you will crash.

Remember Windows is far smarter than you. Stop trying to cripple your machine. Windows is an adaptive tuning machine designed to run on hardware that is designed to page. Open documents are becoming page file type opening rather than stream type opening because it's fast. So if memory isn't needed it will be paged out. If needed it will be paged in. Everything else is designed around this principal. Don't screw it up.
--
----------------------------------------------------------

"juliadream" <juliadream@psych.net> wrote in message news:uWP9FrNWFHA.2700@TK2MSFTNGP12.phx.gbl...
> One thing I could never understand about Windows XP (as opposed to Unix) is
> that, even when I close ALL applications, not all the memory is returned
> back to the system. Recently I read that when a Windows application is
> closed, some of the associated DLLs remain in memory (so that the
> application can re-launch faster the next time). This would certainly
> explain the memory issue.
>
> How would I be able to see all the DLLs in memory? The Task Manager only
> shows me applications and processes.
>
> More importantly, how do I identify and kill the DLLs associated with the
> applications in question?
>
>

David Candy
07-10-2005, 12:28 AM
It was for explorer only and no longer works.

--
----------------------------------------------------------

"NoMoreMrNiceGuy" <pocobuenoguyREMOVE@yahoo.com> wrote in message news:eeO7IyPWFHA.2984@tk2msftngp13.phx.gbl...
> juliadream wrote:
>> One thing I could never understand about Windows XP (as opposed to Unix) is
>> that, even when I close ALL applications, not all the memory is returned
>> back to the system. Recently I read that when a Windows application is
>> closed, some of the associated DLLs remain in memory (so that the
>> application can re-launch faster the next time). This would certainly
>> explain the memory issue.
>>
>> How would I be able to see all the DLLs in memory? The Task Manager only
>> shows me applications and processes.
>>
>> More importantly, how do I identify and kill the DLLs associated with the
>> applications in question?
>
> I think there is a registry key which instructs the system to unload
> dlls when the application is closed.....at least there was for Win 2000.
> Sorry I can't remember the name or location. Maybe someone else can
>
> Norm

Rick \Nutcase\ Rogers
07-10-2005, 12:28 AM
Hi,

It may be that the program(s) itself/themselves are not properly releasing
the stack upon termination (aka "memory leak"). This would be due to poor
programming or a conflict between applications, not a problem with memory
management - meaning it would occur under any OS. The process watcher from
sysinternals can probably catch this, watch for unterminating threads.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP
http://mvp.support.microsoft.com/
Associate Expert - WindowsXP Expert Zone
www.microsoft.com/windowsxp/expertzone
Windows help - www.rickrogers.org

"juliadream" <juliadream@psych.net> wrote in message
news:OAxl$LPWFHA.1508@tk2msftngp13.phx.gbl...
>
> "Malke" <notreally@invalid.com> wrote in message
> news:uEJ13YOWFHA.3864@TK2MSFTNGP10.phx.gbl...
>
>> You could look at one of the free process explorer type tools from
>> Systernals. But why are you bothered about this? Are you having a
>> problem? When you close out of a program in a *nix system, there are
>> still lots of processes going on in the background, libraries, etc. Do
>> a ps axu to see. Or run top. If you are having problems with a Windows
>> system, please post back with details of the problem and the system so
>> we can help you.
>
>
> Certainly. Here are the details. The scenario is the same for Windows XP
> (which I use at home) and Windows 2K (which I use at work). Both machines
> have 512MB of RAM. Once I run a few compute-intensive applications
> simultaneously, both systems become (understandably) slow and
> unresponsive. Common sense would dictate that if I were to close all these
> applications, the Windows systems would become as fast and responsive as
> they were before I launched the applications. Unfortunately, that' not
> the case. I usually end up having to reboot the machines to get optimal
> performance back.
>
> Task Manager is giving me no clues. If it's not the resident DLLs, then
> what could it be?
>
>

Al Dykes
07-10-2005, 12:28 AM
In article <OAxl$LPWFHA.1508@tk2msftngp13.phx.gbl>,
juliadream <juliadream@psych.net> wrote:
>
>"Malke" <notreally@invalid.com> wrote in message
>news:uEJ13YOWFHA.3864@TK2MSFTNGP10.phx.gbl...
>
>> You could look at one of the free process explorer type tools from
>> Systernals. But why are you bothered about this? Are you having a
>> problem? When you close out of a program in a *nix system, there are
>> still lots of processes going on in the background, libraries, etc. Do
>> a ps axu to see. Or run top. If you are having problems with a Windows
>> system, please post back with details of the problem and the system so
>> we can help you.
>
>
>Certainly. Here are the details. The scenario is the same for Windows XP
>(which I use at home) and Windows 2K (which I use at work). Both machines
>have 512MB of RAM. Once I run a few compute-intensive applications
>simultaneously, both systems become (understandably) slow and unresponsive.
>Common sense would dictate that if I were to close all these applications,
>the Windows systems would become as fast and responsive as they were before
>I launched the applications. Unfortunately, that' not the case. I usually
>end up having to reboot the machines to get optimal performance back.
>
>Task Manager is giving me no clues. If it's not the resident DLLs, then
>what could it be?
>
>



Have you looked at the View/Select Colums option in Task Manager ?
There's lots there. perfom.exe will tell you more about what your
system than task manager

--
a d y k e s @ p a n i x . c o m

Don't blame me. I voted for Gore.

T. Waters
07-10-2005, 12:29 AM
Al Dykes wrote:
> In article <OAxl$LPWFHA.1508@tk2msftngp13.phx.gbl>,
> juliadream <juliadream@psych.net> wrote:
>>
>> "Malke" <notreally@invalid.com> wrote in message
>> news:uEJ13YOWFHA.3864@TK2MSFTNGP10.phx.gbl...
>>
>>> You could look at one of the free process explorer type tools from
>>> Systernals. But why are you bothered about this? Are you having a
>>> problem? When you close out of a program in a *nix system, there are
>>> still lots of processes going on in the background, libraries, etc.
>>> Do a ps axu to see. Or run top. If you are having problems with a
>>> Windows system, please post back with details of the problem and
>>> the system so we can help you.
>>
>>
>> Certainly. Here are the details. The scenario is the same for
>> Windows XP (which I use at home) and Windows 2K (which I use at
>> work). Both machines have 512MB of RAM. Once I run a few
>> compute-intensive applications simultaneously, both systems become
>> (understandably) slow and unresponsive. Common sense would dictate
>> that if I were to close all these applications, the Windows systems
>> would become as fast and responsive as they were before I launched
>> the applications. Unfortunately, that' not the case. I usually end
>> up having to reboot the machines to get optimal performance back.
>>
>> Task Manager is giving me no clues. If it's not the resident DLLs,
>> then what could it be?
>>
>>
>
>
>
> Have you looked at the View/Select Colums option in Task Manager ?
> There's lots there. perfom.exe will tell you more about what your
> system than task manager

Al, thanks for the info.
Best tip I've read all week!

DevilsPGD
07-10-2005, 12:29 AM
In message <#vkpkSUWFHA.2540@tk2msftngp13.phx.gbl> "Rick \"Nutcase\"
Rogers" <rick@mvps.org> wrote:

>It may be that the program(s) itself/themselves are not properly releasing
>the stack upon termination (aka "memory leak"). This would be due to poor
>programming or a conflict between applications, not a problem with memory
>management - meaning it would occur under any OS. The process watcher from
>sysinternals can probably catch this, watch for unterminating threads.

The OS should (and in the case of NT-based OSes, does) clean up after
the application when the application terminates.


--
It's always darkest before dawn. So if you're going to
steal your neighbor's newspaper, that's the time to do it.

Rick \Nutcase\ Rogers
07-10-2005, 12:29 AM
Yes, but often not immediately thus causing a performance lag when a
misbehaving application is terminated. Eventually, left to its own devices,
the OS will return performance to normal as the cached files are purged.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP
http://mvp.support.microsoft.com/
Associate Expert - WindowsXP Expert Zone
www.microsoft.com/windowsxp/expertzone
Windows help - www.rickrogers.org

"DevilsPGD" <spamsucks@crazyhat.net> wrote in message
news:a56f81lfq11kipnjjtjiasj4pe7s6872d1@news.readfreenews.net...
> In message <#vkpkSUWFHA.2540@tk2msftngp13.phx.gbl> "Rick \"Nutcase\"
> Rogers" <rick@mvps.org> wrote:
>
>>It may be that the program(s) itself/themselves are not properly releasing
>>the stack upon termination (aka "memory leak"). This would be due to poor
>>programming or a conflict between applications, not a problem with memory
>>management - meaning it would occur under any OS. The process watcher from
>>sysinternals can probably catch this, watch for unterminating threads.
>
> The OS should (and in the case of NT-based OSes, does) clean up after
> the application when the application terminates.
>
>
> --
> It's always darkest before dawn. So if you're going to
> steal your neighbor's newspaper, that's the time to do it.


DLLs resident in memory