Putting the page file in RAM disk

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
So, if the system is booted with the /3G parameter, can the total memory usage be 3G even though no individual program is "3G aware"?

No, it has nothing to do with the total physical memory usage, it only changes the VM split between the kernel and userland processes which is always 4G total on a 32-bit machine.

And yes, I have taken an OS course. Unfortunately, I have to admit that the professor didn't really teach us anything...

Then grab a copy of Understanding the Linux kernel or Inside Windows 2000 (not sure if there's a 2003 or XP version, but the differences wouldn't be that big), both have chapters on memory management.

Unfortunately, much of that hearsay comes from OSS Zealots who have thier own reasons to spread
FUD back at the MS marketing machine. And keep in mind that much of the bashing on Windows
code is based on Windows 9x design, not 2000/XP.

But the fact remains that anyone can look at and critique OSS code but most people will never be given the chance to see the Windows source code.

I do have to believe that since they give the source code to colleges and some special clients, that it can't be so bad that it's unmanagable but I also can't believe that things like the RPC server or SMB server would be considered 'clean' code because of all the backwards compatibility and hacks necessary in them.
 

jthg

Member
Nov 11, 2003
100
0
71
Originally posted by: Nothinman

No, it has nothing to do with the total physical memory usage, it only changes the VM split between the kernel and userland processes which is always 4G total on a 32-bit machine.

I think you misread my question. I was basically wondering whether one could run two applications, each one using 1.5gigs of memory, while neither of them is "3G aware".

I would imagine that the answer is yes because each applications should only be concerned w/ its own virtual memory space and it should not matter where in physical memory or page file its memory pages actually are.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
You can, but you don't want to. It doesn't work like you think it does, not quite...

The 4gig virtual memory limit is something that is built into the archatecture.

To get past that limitation they use PEA, which is a hack and is something you don't want to have to use unless you have too.

Which you don't because we've had 64bit machines for a dozen or so years now. Of course if you want to use 64 windows your going to have to wait a couple more years for Longhorn, unless you like unsupported beta software. Ah the joys of Unix.

Look up PEA....

Or better yet go here and learn how the linux virtual memory manager works and it will teach you enough that you'll understand everything you need to know about how Windows memory works. (similar solution, for similar purposes on the same types of computers)
readme
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I think you misread my question. I was basically wondering whether one could run two applications, each one using 1.5gigs of memory, while neither of them is "3G aware".

Of course, each app gets 2G of VM space normally so that's 4G, with the /3G switch that means each has access to 3G worth of addresses if they're marked aware. But you also have to realize that chunks of VM are used for lots of other things like mmaped files, so for instance if your process uses a lot of DLLS that address space will be smaller than 2G or 3G.

I would imagine that the answer is yes because each applications should only be concerned w/ its own virtual memory space and it should not matter where in physical memory or page file its memory pages actually are.

There's no 'should' about it, a userland process can only see the VM that the kernel gives it. There's no way for a process to see another process' memory without cooperation and using something like shared memory or debugging the other process which requires special rights on Windows.
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
Originally posted by: drag
To get past that limitation they use PEA, which is a hack and is something you don't want to have to use unless you have too.
It isn't a hack. PAE (physical addressing extension) is an Intel standard and it works just fine by adding 2 bits of physical address space to x86; apps are oblivious unless each app needs to use >4GB of virtual memory, in which case it has to use a special API, called AWE (address windowing extensions) to make use of memory beyond the flat 4-gig space provided by 32-bit x86 natively. This feature has been running on major database servers for several years now with great success, allowing multi-gigabyte databases to be cached completely in RAM.

In fact, to enable the AMD64 chip's NX flag, XPSp2 essentially runs in PAE mode, enabling the extra level of page table lookup to support the flag. So I suspect that lots of people are now using PAE without even knowing about it.

Which you don't because we've had 64bit machines for a dozen or so years now. Of course if you want to use 64 windows your going to have to wait a couple more years for Longhorn, unless you like unsupported beta software.
Windows XP x64 edition (supporting AMD64), which is based on the Server 2003 kernel, is targeted for first half of next year (2005). That's well ahead of Longhorn.
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
Actually: can we agree to let this thread DIE (as it should) and continue this discussion elsewhere?
 

flamingspinach

Senior member
Nov 4, 2004
354
0
0
Originally posted by: n0cmonkey
Originally posted by: drag
It's doesn't pay to second guess microsoft software engineers...

It doesn't? I heard that windows source code is a big tangled mess... Besides, MS only designed XP for generic consumer machines. I doubt they optimized XP for high memory comps.

I think what drag meant was not that Windows is so excellently coded that nothing you could ever do would improve it, but rather that Windows is so fragile that whatever you do to it is bound to have unexpected results. ;)

-fs
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Actually what I ment is that Microsoft enginneers pretty much knew what they were doing and designed a memory sceme for the OS that everybody expects to be operating in certain way. Change how the memory sceme works, you change the expectations that application designers used and you'll break things.

It's not anything about it being a tangled mess or being perfect, but it's the expectations programs and the rest of the OS has.

Right now WinXP was designed for a different era of computers. The thing is nearly six years old and is beginning to show it's age, expect Longhorn to take advantage of the massive amounts of memory that are aviable in standard PCs more effeciently. But right now if you mess with it the benifit you get from 100% effective changes is going to be less then 2% of a performance increase, and the majority of the time you'll get a decline in performance.
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
Originally posted by: drag
Right now WinXP was designed for a different era of computers. The thing is nearly six years old and is beginning to show it's age, expect Longhorn to take advantage of the massive amounts of memory that are aviable in standard PCs more effeciently. But right now if you mess with it the benifit you get from 100% effective changes is going to be less then 2% of a performance increase, and the majority of the time you'll get a decline in performance.


:thumbsup:
This is very insightful.
 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
Originally posted by: jthg
Putting the page file in RAM disk


Why on earth do YOU have a PC with 2GB of RAM? It's so you can brag to your AOL buddies isn't it?


 

shinryuu

Junior Member
Mar 11, 2004
15
0
0
Regarding this, I have a question.

I have 1 GB of RAM. When I open up tons and tons of software, rather than filling the RAM up to near capacity, it starts paging stuff out, and active memory in use hovers around 450 MB. Why does it never reach near capacity (like say 900) before starting to page stuff out?

I have tried both ways, using tweak programs to keep stuff loaded in memory, keep kernal in memory, conservative swap file usage, etc, etc, etc. And I have tried it without the tweaks on a clean system.

So, say for example, I am surfing the web, and have maybe 10 tabs open in FireFox. Leaving it open, I decide to burn a Data DVD. After thats done, RAR/unRar a 100 MB file. When I come back to FireFox, it takes almost 20 seconds for the window to MAXIMIZE, because it is reading it all out of pagefile. Why would it put it in pagefile in the first place, because there was plenty of memory available to just keep it there.

So, I tried a RAMDisk, and out of the 1 GB, i made a 260 MB RamDisk, and put a 256 MB pagefile on it. When I repeated the tasks, BOOM, Firefox poped back open like nothing. All 10 tabs on it loaded back up super fast.

My question is basically this: Is there anyway to configure XP to prevent it from paging stuff out and get it to use the RAM that I have (get it to use the 1 GB, rather than page out, or am I doing something wrong?) ?

If there is, please tell me! If there is not, try this experiment. You will be amazed.
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
Originally posted by: shinryuu
My question is basically this: Is there anyway to configure XP to prevent it from paging stuff out and get it to use the RAM that I have (get it to use the 1 GB, rather than page out, or am I doing something wrong?) ?

If there is, please tell me! If there is not, try this experiment. You will be amazed.

Have you tried running without a pagefile? That would, by definition, not allow the working set trimmer to page out your app's allocated virtual memory to the paging file.