Putting the page file in RAM disk

jthg

Member
Nov 11, 2003
100
0
71
I have 2 gigs of memory on my system but I can't really disable the page file because there are A LOT of programs that complain about the absense of a page file. So, what do you think about creating a 100 mb ram drive and sticking the page file in there?

Thanks
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
I don't think much of it at all.

Just let it have it's little ol' pagefile on the harddrive. It's not going to slow down anything, and what's better it's not going to break anything.

Your OS is designed and programmed specificly to use a page file. All the developers expect a page file. All programs expect a page file. Everything in the OS screams that you need to have a page file. So just let the poor OS have it's page file on the harddrive.

It's doesn't pay to second guess microsoft software engineers...

If you need reasons why, or you think that you shouldn't have to have a page file, just search the OS forums for previous page file discussions and the flames that resulted.
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
As drag said, this is a bad idea. Much worse than just setting your page file to ~100 megs or so. The OS knows how to use a pagefile efficiently.
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
From the topic summary:
I know it's inefficient, but it would keep certain progs from crashing...
What apps are crashing due to having a page file on disk? Apps shouldn't be able to tell whether the page file is on a real drive or a RAM drive.
 

J1600B

Senior member
Nov 15, 2002
246
0
0
I recently read an article that talks of a program that will basically create a RAMDrive and assign it a letter and shows up in My Computer. You could then assign your pagefile to that Drive letter. I can't find the article right now, but it had to do with security, and about how RAM is erased every boot but hard drives are not blah blah. Seems like giving a 500 MB pagefile on a Ram Drive would really speed up some things maybe like Photoshop or video games?..
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Well, only if the programs are badly designed.

There are some programs that will say "I want this in pagefile", but I think most of those would be obsolete win9x type affairs. Don't realy know, just guessing mostly.

The main point to a swap space is to pick up the slack. In your computer there are various levels of abstraction, so that programmers don't have to deal with the details. You see that your dealing with a multi-tasking OS and the OS has to juggle around resources. If the application designer had to account for all possiblities in a multi-tasking enviroment his job would be impossible.

So virtual memory is one of those levels of abstraction. In a 32bit x86 machine you can have a maximum address space of 4gigs for memory. That 4gigs is called "virtual memory". It's a idea dreamed up by IBM way way back in the day.

So instead of the application going "umm.. the OS tells me I have 200megs to work with.. so I want to assign this and this and this to main ram, and this and this can be stuck into the swap space. So if hte user wants to do this task, then I have to move a out of RAM and into the disk and move b back into RAM", it just goes "assign this into memory" and the OS itself takes care of the details about were to stick it and how to manage it. It makes for a more effecient computer and such.

So in NT windows (NT 4.0, W2k, XP) you have always have 4gigs of virtual memory, 2gigs is reserved for the OS itself and 2gigs is reserved for Applications. If you have 128 megs of RAM, and a 300 meg page file, you have 4gigs of virtual memory. If you have 2 gigs of RAM and a 100 meg page file you have 4gigs of virtual memory.

So say you do take a 500 meg page file and stick it into a ramdisk in your 2gig main memory. Well then you have a 4gigs of virtual memory that has to share 2 hunks of ram, 1.5 and 500meg.

What happens if you have a bunch of applications open and your OS actually NEED, say 2050megs of memory to keep everything working? Or say some application is failing and is eating up memory like crazy?

In a normal OS your page file would just grow by a few megs and everything still works, abiet slightly slower and your thrashing your disk.

however with your page file cleverly stuck on ramdisk, stuff just starts failing. Your OS starts locking up, maybe, or your applications start crashing weirdly screwing up stuff on your harddrive, or maybe your OS has a out of memory killer and just starts randomly killing applications. Something bad.

After all you bought all that RAM to be used, right?

Just leave it alone. Windows XP is a hell of a lot smarter then Windows 9x was with stuff, and applying technics such as page file manipulation is fairly worthless endevour.
 

jthg

Member
Nov 11, 2003
100
0
71
Thanks for the responses.

I guess even if it did speed things up it would be by a less than neglibible amount. I was mostly thinking of this program I ran several years ago that kept using the page file even when there's tons of memory left. I'm pretty sure it was actually paging cus I was running it off an external firewire drive and it was constantly reading the internal HD. (If anyone's wondering, the prog is called BGII...slightly old...)

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.

Originally posted by: drag
So in NT windows (NT 4.0, W2k, XP) you have always have 4gigs of virtual memory, 2gigs is reserved for the OS itself and 2gigs is reserved for Applications.

I think they somehow got rid of the simple flag bit and did something wierd so that user space is 3.7gigs and kernal space is 300mb... or maybe this only applies to Win2k3 ... not really sure...

Originally posted by: drag
After all you bought all that RAM to be used, right?

All of the RAM above 1.5gigs is intended to never be used. If I do end up using it, I'll buy another gig that's intended to never be used.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: J1600B
I recently read an article that talks of a program that will basically create a RAMDrive and assign it a letter and shows up in My Computer. You could then assign your pagefile to that Drive letter. I can't find the article right now, but it had to do with security, and about how RAM is erased every boot but hard drives are not blah blah. Seems like giving a 500 MB pagefile on a Ram Drive would really speed up some things maybe like Photoshop or video games?..

A 500MB pagefile on a ramdisk? Think about that for a second. Think real slowly.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: jthg
Thanks for the responses.

I guess even if it did speed things up it would be by a less than neglibible amount. I was mostly thinking of this program I ran several years ago that kept using the page file even when there's tons of memory left. I'm pretty sure it was actually paging cus I was running it off an external firewire drive and it was constantly reading the internal HD. (If anyone's wondering, the prog is called BGII...slightly old...)

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.

Originally posted by: drag
So in NT windows (NT 4.0, W2k, XP) you have always have 4gigs of virtual memory, 2gigs is reserved for the OS itself and 2gigs is reserved for Applications.

I think they somehow got rid of the simple flag bit and did something wierd so that user space is 3.7gigs and kernal space is 300mb... or maybe this only applies to Win2k3 ... not really sure...

Originally posted by: drag
After all you bought all that RAM to be used, right?

All of the RAM above 1.5gigs is intended to never be used. If I do end up using it, I'll buy another gig that's intended to never be used.

It still gets used. ;)
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: jthg
True... stupid System Cache...

Exactly. If you want to mess around with this sort of stuff you realy need to be using something that is more open, like Linux or FreeBSD. People have made all sorts of weird little patches for tweaking this and that. You have many file systems to choose from, each tailored to be strong in a specific task. It's just flexible.

Windows on the other hand is designed to be a black box. All different peices of software make assumptions about swappiness and location of the page file and all sorts of things. All these assumptions, that's why when you disable cache, it makes some things crash. And who knows what else weirdness it does? Nobody, not even most Microsoft people if any could tell you the full effect of what happens. It just works with the settings they gave it. It works, they tested it, they massaged it for best performance, it's their baby.

You and me? We are outsiders. We pay to have it work, we pay for them to make sure that it works. (not that it works all the time mind you.)

But then again with my messing around with linux and experimenting with it and different setups, it turns out that a page file increases the efficiently of the memory management and it's cheap insurance against the OOM killer. Most people end having a gig or two partition just for the swap partition. Disk space is cheap, and losing information in a app because you unexpected used up all your ram, sucks. Plus it's a good indication of problems when your disk starts thrashing you generally get plenty of time to correct the problem, if you only have main memory space, then the effect can be immediate and without warning if your not paying close attention to memory usage (who does day to day?).
 

kmmatney

Diamond Member
Jun 19, 2000
4,363
1
81
A great, free, RAM disk program can be found at:

http://www.arsoft-online.de/products/product.php?id=1

It works in all MS operating systems I've tried it on. We use it for transferring large files between software programs written in different (and some very old) programming languages. It is very fast. You can also setup Internet Explorer to use it for caching, and it speeds things up. I also use the RAM disk for storing temp items and downloads. I don;t have to remember to clean up the files afterwards.
 

jthg

Member
Nov 11, 2003
100
0
71
Why do that? Do you just mean making a virtual drive that's a file on another drive?
 

jthg

Member
Nov 11, 2003
100
0
71
Originally posted by: kmmatney
A great, free, RAM disk program can be found at:

http://www.arsoft-online.de/products/product.php?id=1

It works in all MS operating systems I've tried it on. We use it for transferring large files between software programs written in different (and some very old) programming languages. It is very fast. You can also setup Internet Explorer to use it for caching, and it speeds things up. I also use the RAM disk for storing temp items and downloads. I don;t have to remember to clean up the files afterwards.

Cool. I'll try it.

Too bad RAM disks r cleared on shutdown...
 

jthg

Member
Nov 11, 2003
100
0
71
kmmatney, can you explain to me what the Startup Types (System / Automatic) and what the Operating modes (RAM Disk mode / Emulate a local hard disk) mean?

I guess I could just try all of them but apparently that requires several reboots...
 

J1600B

Senior member
Nov 15, 2002
246
0
0
Originally posted by: kamper
Originally posted by: J1600B
I recently read an article that talks of a program that will basically create a RAMDrive and assign it a letter and shows up in My Computer. You could then assign your pagefile to that Drive letter. I can't find the article right now, but it had to do with security, and about how RAM is erased every boot but hard drives are not blah blah. Seems like giving a 500 MB pagefile on a Ram Drive would really speed up some things maybe like Photoshop or video games?..

A 500MB pagefile on a ramdisk? Think about that for a second. Think real slowly.

I'm still thinking and I don't see much of a down side. Granted, a bigger one may be better, but having the page file on a RAMDisk vs a Hard disk is going to be a HUGE improvement for database applications, MS Office type programs, basically everything that tends to remember a lot of information for later use.

How about think real slow about this article.

If thats too much reading for your opinion, here's a quote for you

" That makes the ramdisk 12 times faster than the hard disk and 304 times faster then the floppy"
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
Originally posted by: J1600B
Originally posted by: kamper
Originally posted by: J1600B
I recently read an article that talks of a program that will basically create a RAMDrive and assign it a letter and shows up in My Computer. You could then assign your pagefile to that Drive letter. I can't find the article right now, but it had to do with security, and about how RAM is erased every boot but hard drives are not blah blah. Seems like giving a 500 MB pagefile on a Ram Drive would really speed up some things maybe like Photoshop or video games?..

A 500MB pagefile on a ramdisk? Think about that for a second. Think real slowly.

I'm still thinking and I don't see much of a down side. Granted, a bigger one may be better, but having the page file on a RAMDisk vs a Hard disk is going to be a HUGE improvement for database applications, MS Office type programs, basically everything that tends to remember a lot of information for later use.

How about think real slow about this article.

If thats too much reading for your opinion, here's a quote for you

" That makes the ramdisk 12 times faster than the hard disk and 304 times faster then the floppy"

That article discusses OS that didn't have virtual memory. Anyway, nobody is arguing that ramdrives aren't fast. We're arguing that the OS knows better than you do what things belong on a page file and what things belong in ram.

Let's use a simple example. You have a bunch of books you want to use - say, a set of encyclopedias. You also have an assistant who looks at what you're reading and figures out when you're done using something / guesses what you might want to read next. You have a desk that holds 10 books (RAM) which you can read in 1 second each, and an (unlimited) room of books that takes 12 to 304 times as long to access.

When you have your page file on disk, if you read a book and then don't touch it for a while, your assitant will move it into the big room and get something you're more likely to use (say you're reading an encyclopedia set - if you're reading L and last read K, the assitant gets M and puts J back) so you don't have to wait when you're ready for the next data.

When you have your page file in RAM, instead of having 10 places to put books or notes, you agree with your assistant that only 5 of those places can be used for work, and whenever the assistant would have moved something unused into the big unlimited room, the assistant has to fit it into the other 5 spaces. Sure, if you want something from those 5 spaces, you get it faster, but there is a major problem. If you want to work with 10 books, you have to keep swapping books in and out of the work area - had you not made this stupid agreement with the assistant, you could just use all 10 books.

If originally you wanted to use 11 books, you'd have to keep going back and forth to the big room, so you'd be waiting a lot. With the arrangement described above, you'd be just as bad off, so you gained nothing. If you use 6-10 books, you lose with the new arrangement, and with 1-5 books there's really no effect. You also have to remember that your assistant was trained in how to properly move data around when the "big room" is 1) big, and 2) slow. When you put the page file on something as fast and small as a ramdisk, you're probably not getting optimal usage.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: J1600B
Originally posted by: kamper
Originally posted by: J1600B
I recently read an article that talks of a program that will basically create a RAMDrive and assign it a letter and shows up in My Computer. You could then assign your pagefile to that Drive letter. I can't find the article right now, but it had to do with security, and about how RAM is erased every boot but hard drives are not blah blah. Seems like giving a 500 MB pagefile on a Ram Drive would really speed up some things maybe like Photoshop or video games?..

A 500MB pagefile on a ramdisk? Think about that for a second. Think real slowly.

I'm still thinking and I don't see much of a down side. Granted, a bigger one may be better, but having the page file on a RAMDisk vs a Hard disk is going to be a HUGE improvement for database applications, MS Office type programs, basically everything that tends to remember a lot of information for later use.

How about think real slow about this article.

If thats too much reading for your opinion, here's a quote for you

" That makes the ramdisk 12 times faster than the hard disk and 304 times faster then the floppy"

And if that's too much thinking for you here's a quote from the very same article:
" it takes memory space away from other uses"

What if you make your ramdisk so big it takes up all your memory? Then it'd be super fast, yeah! :confused:

Or just read CTho's explanation. That's good too.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
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.

Define a big tangled mess? Have you looked at the Linux source code? Can you make heads or tails of it? Would you call it a big tangled mess? It's all relative to how well you know the system and how well you can program. Obviously there are things that are 'obviously bad' and need cleaned up, but you can't make such a blanket statement about something you've never seen and probably wouldn't understand even if you had seen it.

And by high memory do you mean ones with like 64G memory that Win2K3 runs on? You realize that Win2K3 uses the same kernel as XP, right?

I think they somehow got rid of the simple flag bit and did something wierd so that user space is 3.7gigs and kernal space is 300mb... or maybe this only applies to Win2k3 ... not really sure...

No, it's still a 2/2 split. If you specify the /3G boot parameter in boot.ini the kernel will only get 1G and userland processes will get 3G if they're marked "3G aware" otherwise they still only see 2G and 1G isn't used.

True... stupid System Cache...

Go take a class on OS design and VM development and you'll then realize how stupid a statement that is.
 

jthg

Member
Nov 11, 2003
100
0
71
Originally posted by: Nothinman
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.

Define a big tangled mess? Have you looked at the Linux source code? Can you make heads or tails of it? Would you call it a big tangled mess? It's all relative to how well you know the system and how well you can program. Obviously there are things that are 'obviously bad' and need cleaned up, but you can't make such a blanket statement about something you've never seen and probably wouldn't understand even if you had seen it.
"Big tangled mess" means exactly that. No I can't claim to have ever looked the source code for either operating system (unless glacing at the Linux source code counts...) but **again, this is hearsay** I've heard that Linux code is efficient while Windows code is like what I write at 12:00am when the project is due the next day.

Originally posted by: Nothinman

No, it's still a 2/2 split. If you specify the /3G boot parameter in boot.ini the kernel will only get 1G and userland processes will get 3G if they're marked "3G aware" otherwise they still only see 2G and 1G isn't used.

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"?

Originally posted by: Nothinman

True... stupid System Cache...

Go take a class on OS design and VM development and you'll then realize how stupid a statement that is.

That was a sarcastic statement btw.

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

Edit: Added some stuff.
 

IEC

Elite Member
Super Moderator
Jun 10, 2004
14,573
5,971
136
You really shouldn't be having these problems with 2GB of RAM! I usually partition my hdd so that one partition is a dedicated swap, and make it 2048 min 4096 max MB so that it won't need to expand when it's used.
 

CQuinn

Golden Member
May 31, 2000
1,656
0
0
"Big tangled mess" means exactly that. No I can't claim to have ever looked the source code for either operating system (unless glacing at the Linux source code counts...) but **again, this is hearsay** I've heard that Linux code is efficient while Windows code is like what I write at 12:00am when the project is due the next day.

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.

Its obvious that Windows carries a lot of idiosyncracies and kludges from legacy development,
but (at the current size of the codebase) it wouldn't be managable at all if it was a big tangled mess.

Any modern OS could stand having a seperate team who is just there to review and clean up old code,
MS is one of the few companies that actually employs such a team.