On 13.02.2008, at 11:26, Nicolás wrote:
Hi!
LyX seems to make a good use of RAM just after it has been started
up. When a file is closed the memory the file was using is released
and when LyX is minimized, the memory used is reduced to a minimum.
That's great! However, this is no longer true when LyX is running
and I go into and come back from hibernation. I am using v1.5.2 on
Windows XP. I wonder if this is a problem of LyX that could be
solved, or whether it is a problem with hibernation that is out of
the scope of LyX.
I doubt that this behavior has anything to do with LyX. Instead, I
assume that changes in memory consumption you observed are related to
the working set of the LyX process, which is under the control of the
operating system.
In Windows, every process has a contingent of memory pages kept in
RAM, called the working set. If this contingent of pages is exceeded,
the least accessed pages are moved from the working set to the global
system cache. They are still in RAM and could be restored quickly if
the process accesses them again. However, If the system is getting
short on physical memory, pages from the system cache are discarded
and have to be swapped in from disk on the next time they are accessed
again.
Depending on the global memory situation and the expected user
activity, Windows heuristically extends or reduces the working sets of
processes. If you minimize a process, Windows reduces (trims) the
working set as it does not expect you to actually work with a
minimized process. This is the behavior you observed when minimizing
LyX.
If the system is asked to go to hibernation, Windows aggressively
reduces the working set of all processes. This is to reduce the number
of RAM pages that have to be written to the hibernation file. After
awaking back from hibernation, the working set of the LyX process is
therefore still fairly small; depending on user activity it will grow
over time to its previous limit. If, however, you minimize LyX or
close a document immediately after the system came back from
hibernation, the chance is high that the working set has still not
been expanded to a value that would cause Windows to trim it again.
Long story, short conclusion: The behavior you described is most
probably caused by the OS.
Daniel