[leveller] Re: Large terrain difficulties

  • From: "Adam Hauldren" <adam@xxxxxxxxxxxxxxxxxxxxxx>
  • To: <leveller@xxxxxxxxxxxxx>
  • Date: Sun, 17 Jul 2005 11:35:17 +0100

> > Well, that beats the previous record holder. Largest I'd heard
> > of before was ~8,000^2.
> 
> Hehe- yes we are all insane here at ME-DEM ;)

I'll vouch for that! ;)

> > Actually, I wonder... this would be a good time to find out how
> > much memory is needed by Windows to maintain all the memory 
> > pages. It can be significant on large RAM systems.

> I'm not a techie so I don't know.

Each process has its own page directory, which contains a list of 1024 (210)
page directory entries (PDEs) that describe the location of a single page
table for the process.

Each page table, has 1024 page table entries (PTEs) that store two types of
information:

1) a page frame number (PFN) that specifies how a 4 KB range of virtual
address space maps to physical memory
2) some flags that describe the page frame's current state and protection
levels.

So the amount of kernel memory overhead for memory management should
theoretically not be excessive, even with high ram-usage applications,
because as far as I know, by default, Windows XP uses 4Kb page tables,
unless they call many external processes that might require extra page
directories.

There's some low-level technical stuff here, but you'll want to be a
programmer to consider reading most of it:
http://www.informit.com/articles/article.asp?p=167857&seqNum=1

That's the extent of my tech knowledge on the subject from previous years as
a Microsoft Certified Trainer. I have never been a programmer though, so am
interested in any insights from more "register-literate" listmembers ;)

> My virtual memory is set to x2 of my RAM because I use this
> machine to work with very large files in a number of apps.

One thing worth mentioning if you haven't already implemented it, is to set
your pagefule size to at least the recommended amount, and more importantly,
set the minimum and maximum sizes to the same amount.

This will prevent windows from dynamically increasing the size of the
pagefile (and undoubtedly it's fragmentation also) and will reduce VM
overheads (in terms of disk thrashing and CPU usage) when large amounts of
pagefile are in use.

There are several other ways to optimise pagefile access, some of which
involve registry editing & some of which depend on your system spec. There's
some good memory-tweaking tips here:
http://www.techspot.com/tweaks/memory-winxp/

Windows' memory models all utilise pagefile space regardless of the amount
of physical memory available to the application, and 32-bit apps currently
have access only to 2Gb of memory address space. This can pushed to 3Gb with
certain versions of windows, and some editing of the boot.ini file.

Ray, is Leveller 3Gb-aware? If not, I believe it only requires that you
compile the app with the LARGEADDRESSAWARE bit set. I haven't tested it, but
MS have a tool called Editbin which (supposedly) allows the
LARGEADDRESSAWARE bit to be set on any executable. It ships as part of the
Visual Studio devkit.

> > Oh, here it is... the smoking gun. :) There's a piece of code that 
> > reads:
> >
> > CMainWnd::OnTimer()
> > {
> > #ifdef JEALOUS
> > if(::system_specs().better_than(RAYS_PC))
> > {
> > if(rand() == 0) ::crash();
> > }
> > #endif
> > }

>  Hahaha!!
>  ...hey shouldn't that be #ifdev JEALOUS
>  :D

:)

Regards

Adam

Other related posts: