Computer Chess Club Archives




Subject: Re: is the

Author: Robert Hyatt

Date: 13:39:39 07/24/98

Go up one level in this thread

On July 24, 1998 at 14:34:01, Tom Kerrigan wrote:

>On July 24, 1998 at 09:28:26, Robert Hyatt wrote:
>>however, if the memory management is done *right* then active programs page in,
>>inactive programs page out, and the paging stops, assuming (a) the active
>>program can actually fit into real memory and (b) that there are not more active
>>programs than can actually fit into real memory.  Playing chess should have one
>>compute-bound process and the rest should slowly "go away" to disk.
>This is what happens in Windows.
>When you start a search, all of a sudden you're banging your program's entire
>memory space fast and at random. This more or less forces every other process to
>"go away" PDQ.
>When I'm using a large hash table in Win95, it takes a few seconds to swap in
>all the memory. Same thing happens when I use HP/UX. I'd be surprised if it
>isn't just as bad in LINUX.
>I was just thinking, it's possible that LINUX has a system where it allocates a
>lot of "unused" memory for each process and it has a lot of "unused" pages in
>RAM, so it can swap in an unused page simply by changing some memory around and
>not actually swapping... although this seems like it would be complicated and
>you basically wouldn't have the dynamic disk cache that you do with Win95...

I don't see this in Linux, but it depends on the state of the free memory
list pages.  If they are "clean" (in the so-called "free list") then they don't
have to be written to disk, and are just added to the virtual memory map for
that process, wherever needed.  If they are "dirty" (in the "modified list" in
unix) then before they can be given to another process, they must be flushed to
disk first.  So in linux, on my machine (512mb) you could copy a 512mb file from
one disk to another and fill memory with a copy of the file.  If you copy the
file a second time, almost no reads would be done since most would be in memory.

If, on the other hand, you have a program that produces data and writes it to
disk (512mb worth) then the I/O system will get way behind.  When the app
finishes, starting another big one will take time because all the memory pages
are full of file cache, and *every one* is "dirty" and has to be written to
disk before it can be given to the new program. And that can hurt.

It may be that Win95 is simply not careful about what gets written out and
what can be avoided.  But I just started Crafty on my quad-p6, typed hash=384M
and "go" and got an instant move.  "hash=384M" took about 2-3 seconds to happen
because I clear everything, and it takes about that long to physically write
into 384mb of memory.  But I don't see any huge delays...

This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.