MSFN Forum: PageFile/SwapFile in a RamDisk - MSFN Forum

Jump to content



Unattended CD/DVD Guide Homepage · MSFN Forum Rules

If you have questions about customizing Windows XP that are nLite-specific, please post them in the nLite forum, not here. If you have questions regarding the unattended installation of Windows XP, please post them in the Unattended Windows 2000/XP/2003 section.
  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

PageFile/SwapFile in a RamDisk Possible to do? Speed increase? Rate Topic: -----

#1 User is offline   Pure Krome 

  • Junior
  • Pip
  • Group: Members
  • Posts: 73
  • Joined: 16-August 03

Posted 09 December 2003 - 09:04 PM

Heya folks.

is it possible to have the XP / W2K pagefile/swap file located on a RAMDISK?

if so, any tutorials, etc?


#2 User is offline   Gism0 

  • Huh?
  • PipPipPip
  • Group: Members
  • Posts: 473
  • Joined: 11-November 03

Posted 09 December 2003 - 09:13 PM

Bad Idea.

you are only going to reduce available ram and see no performance increase..

if you have enough ram to even think about doing something like this then you should just disable virtual memory all together in the sytem control panel

#3 User is offline   XtremeMaC 

  • MSFN SuperB
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5,070
  • Joined: 13-October 03

Posted 09 December 2003 - 10:30 PM

hmm virtual memory/swap file is filled up when the ram sources deplete.
so if you were to put the swapfile in the ram that wouldn't make any sense.

you would indeed want to increase your ram and disable the swap file. or lower it to min number(1mb). this way if xp tells you the swap memory is not enough, it will increase it automatically.

it will pop-up saying that there isn't enough virtual memory, windows is increasing the size of your vm.

#4 User is offline   Skyfrog 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 314
  • Joined: 10-September 03

Posted 09 December 2003 - 11:00 PM

Windows only uses the swap file when it runs out of physical memory, so putting it in physical memory (which would have been used anyway) and reducing the total amount available makes absolutely no sense at all. Your swap file would also be confined to the RAM disk, and so it would quickly run out completely. I've found it's best to create a reasonable minimum sized swap file (to cut down on fragmenting) and set the maximum to whatever you have left. Windows will be able to use what it needs when necessary, which shouldn't be often if you have a lot of memory.

If you have enough memory don't worry, but don't disable it. Windows wants a swap file no matter how much memory you have. Instead there is a setting to force Windows to only use it when absolutely necessary. Run msconfig and in System.ini add "ConservativeSwapfileUsage=1" under the 386enh section.

#5 User is offline   XtremeMaC 

  • MSFN SuperB
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5,070
  • Joined: 13-October 03

Posted 09 December 2003 - 11:05 PM

u can set to disable the swap file(page file) though!

@skyfrog what exatly does that lines do?

#6 User is offline   Skyfrog 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 314
  • Joined: 10-September 03

Posted 09 December 2003 - 11:33 PM

It tells XP to use the swap file only when there is absolutely no physical memory at all available, so if you have a lot of memory XP won't try to use the swap file. This is better than just disabling it since you won't be getting any out of memory errors or other complaints, and if you do happen to run out of memory the swap file will be available.

#7 User is offline   un4given1 

  • Elaborate Dreamer
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,796
  • Joined: 25-September 03

Posted 09 December 2003 - 11:36 PM

Skyfrog: I will argue that one with you. I have nearly a gig. My PC is using 400MB and a 200+MB swap file right now. My server at work has over a gig and a half and still uses a good 400MB pagefile at most times.

#8 User is offline   XtremeMaC 

  • MSFN SuperB
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5,070
  • Joined: 13-October 03

Posted 09 December 2003 - 11:37 PM

hmm thanks I'll try it
I've 512mb ram
(for some reason cause my laptop sucks the rams are 133mhz! on a p4 2.0 ghz what a waste of ram!, I want an alienware, anyone volunteer to give me $4000 :))


@un4given1
so if u've 1GB ram and 400 is used and u still have 200+ swap
maybe using that trick in system.ini will make sure that 200+ goes into the 1GB ram? (or are u using that trick already?)

and for the server I'm sure it needs a lot of ram and page file
after all its a server...

This post has been edited by XtremeMaC: 09 December 2003 - 11:44 PM


#9 User is offline   Skyfrog 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 314
  • Joined: 10-September 03

Posted 12 December 2003 - 04:50 AM

Quote

Skyfrog: I will argue that one with you.


I'll take your word for it then. I was only going by what I've been told over the years and the assumption that with that much RAM Windows shouldn't need to use the swap file. I guess it depends on what you do with your computer. :)

I'm just wondering if your computer really needs that much swap space or if XP is just being piggish; you could try the ConservativeSwapfile setting maybe.

#10 User is offline   XtremeMaC 

  • MSFN SuperB
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5,070
  • Joined: 13-October 03

Posted 12 December 2003 - 11:39 AM

I just checked it after a restart
I've 512 ram with the two tweaks I talked about.
my virtual mem is about 200(194mb).?

#11 User is offline   MSNwar 

  • Its Time ...
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,215
  • Joined: 23-December 01

Posted 12 December 2003 - 01:33 PM

We have a guide Optimize the Paging File with some suggestions, dos, and don'ts that might be usefull. Now, the guide I wrote is targeted at a general audience. Please keep that in mind. I will just post some the tips from the guide here as you all are past the basic stage of page file optimazation. However, if you take a quick look at the guide we will assure we are all on the same sheet of music.

From the guide ... Here are some paging file optimization tips:

* Do. The more RAM the better. RAM is faster than a hard drive and the paging file is located on the hard drive. Since the data is constantly swapping locations between the hard drive and the RAM your PC will access the data faster if the majority of the data is in the RAM.

* Do. Use Task Manager and Performance Monitor to monitor the paging file and RAM usage. Since memory prices have dropped, you should always have plenty of RAM. In fact, this is the best thing you can do to optimize your paging file.

* Do. If you have more than one hard drive -- no partitions -- you can split the paging file between these two drives. Alternatively, you can put the paging file on the hard drive that doesn't hold the Operating System, especially if that disk is faster.

* Do Not put paging files on different partitions that belong to the same physical hard drive. This will severely hinder your performance!

* Do. Before you create a new paging file, defragment your hard drive.

* Do. If you know the optimal paging file size for the system, set the initial and maximum size to the same value. This will prevent the paging file from growing and fragmenting.

... end of exerpt from the guide.


The last tip is key. It is targeted at a user who has experimented with the page file and reached a level of system stability and increased performance.

Examples:

- User A has 1 Gig of RAM and one hard drive.
- User B has 1 Gig of RAM and one hard drive.

User A seldom if ever utilizes more than 512 MB of RAM whereas user B constantly approaches the 1 Gig limit.

Addtionally, user A has a 5400 RPM, 12 ms, ATA-66 hard drive and user B has a 7200 RPM, 8 ms, ATA-133 hard drive. User B will transfer data faster between the RAM and page file (located on the hard drive) faster than user A simply because user B has a faster sub-system.

Each and every PC cannot be held to the same page file setting end result as described in the above scenerio.

There are times when XP directs data to the CPU but the CPU and RAM are communicating (moving data between the CPU and RAM) so XP hooks the activity and will seek the paging file. The timing is critical at this stage! When the process cannot be executed in the allocated amount of time XP will error. Best case scenerio is the hour glass and worse case scenerio is the BSOD. This is why we need a at least a minimal page file.

Getting long here, so I will quit.

#12 User is offline   sechs 

  • Newbie
  • Group: Members
  • Posts: 28
  • Joined: 09-December 03

Posted 12 December 2003 - 02:42 PM

Putting the Windows page file on a RAMdisk is something which is discussed about once a month at StorageReview.com. Yes, you can do it, but, boy, is it a dumb idea.

It should occur to people that when you need RAM the most, is when you end up hitting the page file... so, if you dedicate RAM to your page file, then you're only making the page file more necessary and less useful.

Interested parties may want to cross-reference these threads in other fora:
http://forums.storag...?showtopic=1742
http://forums.storag...?showtopic=9290
http://forums.storag...?showtopic=6807
http://forums.2cpu.com/showthread.php?s=&threadid=11689
http://forums.2cpu.com/showthread.php?s=&threadid=33162
http://forums.2cpu.com/showthread.php?s=&threadid=10062
http://forums.2cpu.com/showthread.php?s=&threadid=10014

That last one has a big fat argument in it, so you have to read through it to get the information.

#13 User is offline   MSNwar 

  • Its Time ...
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,215
  • Joined: 23-December 01

Posted 12 December 2003 - 03:49 PM

sechs,

That last one is one of the best reads I have had in years. It involves some of the industries foremost authorities. No way I could read through it all and keep up with the technical aspects in one evening. I will print and safe guard this for a long time. Interestingly, it gets a little off topic, but that is ok as it covers so much to do with the paging file. Not just in general as I explained in my guide, but more importantly in technical detail. This will be a valuable reference for years to come. Got any more like that? Send me your IE Favorites list please :rolleyes:

Thanks :)

#14 User is offline   Aaron 

  • The MSFN Banana
  • Group: Patrons
  • Posts: 5,767
  • Joined: 17-August 01
  • OS:ME
  • Country: Country Flag

Posted 12 December 2003 - 08:36 PM

The ConservativeSwapFileUsage tweak doesn't apply to XP:

http://www.tweakxp.c...ect_tweaks.aspx

#15 User is offline   Pure Krome 

  • Junior
  • Pip
  • Group: Members
  • Posts: 73
  • Joined: 16-August 03

Posted 12 December 2003 - 10:55 PM

wicked! thanks folks :rolleyes:

for some weird reason, i didn't receive any email notifications, so i didn't reply sooner.

i like the mention of => ConservativeSwapfileUsage=1
..
.
until AaronXP said it's useless :)

i'm running XP with 512MB ram. I'm wondering if there are some things we can do to tell XP to use the HD Page File as little as often -- take more ram if needs be before HD?

maybe i'm too blond and missing the point.

#16 User is offline   likuidkewl 

  • [Centos~]$
  • PipPipPipPipPip
  • Group: Members
  • Posts: 960
  • Joined: 16-September 03

Posted 13 December 2003 - 12:13 AM

Why don't you just make it so that windows doesn't have control over your swap file and you make the settings, like 200mb to 200mb? This is what i do, and then it is alot less work for your HD and makes your HD performance better.
*Note those numbers are just an example*

:)

This post has been edited by likuidkewl: 13 December 2003 - 12:13 AM


#17 User is offline   Skyfrog 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 314
  • Joined: 10-September 03

Posted 13 December 2003 - 01:31 AM

Quote

The ConservativeSwapFileUsage tweak doesn't apply to XP:


Thanks, I didn't know that. Now that I've learned something new I did some more searching and came up with the correct tweak for reducing the page file usage on NT/2000/XP systems (though it causes the system to use more RAM). Everyone probably already knows this but I'll post it just in case. It's a registry setting:

[HKLM \ SYSTEM \ CurrentControlSet \ Control \ Session Manager \ Memory Management]

"DisablePagingExecutive"=dword:00000001

#18 User is offline   XtremeMaC 

  • MSFN SuperB
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5,070
  • Joined: 13-October 03

Posted 13 December 2003 - 01:54 AM

well I'm using that already but
I still have 295 mb ram left our of 512ram
and my vm is 246mb already!!! look at this irony!!!
Posted Image

I don't think its working ahah!!

#19 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,519
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 13 December 2003 - 05:40 AM

I have 512mb DDR and this is what I have showing right now.
With the DisablePagingExecutive

Posted Image

#20 User is offline   XtremeMaC 

  • MSFN SuperB
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5,070
  • Joined: 13-October 03

Posted 13 December 2003 - 10:07 AM

hmm interesting I wonder why mine's out of sync!?
your virtual memory is the one that seems to be the least used.
I think my math's processor on the cpu is confused. look at the addition it made on the previous post :)

how did you layout those values so nicely, is there a program to do it?

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy