Post Reply 
How to make use of lots of free RAM on XP
Author Message
ZiNgA BuRgA
Smart Alternative

Posts: 17,023.4213
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.0333
Offline
Post: #1
How to make use of lots of free RAM on XP
There seems to be a general consensus that Vista is the only Windows OS which can actually make use of large amounts of spare memory.  I'd like to take the opportunity to dispell this myth and show that XP can handle large amounts of RAM well - not just Vista.
I'll assume "large" refers to ≥4GB RAM (I have 4GB installed on my machine), which you'll typically never use more than 1GB.

How Vista uses your large amount of free RAM
Basically, Superfetch.  What it does, is observe what files gets accessed often, and caches them by loading them into memory - the idea being to preload these before you issue an on-demand call to launch an application, for example (this speeds up access times since HDDs typically have slow seeks, especially compared to RAM seek times (note that this assumes HDDs have slow seeks - SSDs greatly improve upon this, though RAM is still typically faster than SSDs, but Superfetch will be less effective if you're only using SSDs)).
Throughout this guide, wee'll assume that you're using a HDD (most of you) and wee'll use this idea to speed things up by preloading stuff into RAM.

So what are the issues of Superfetch?
- It's not configurable
- It's AI controlled (in other words, pretty stupid)
- It's rather aggressive, and if you have lots of free RAM, can cause lots of HDD activity (especially if you load/unload large amounts of RAM often)
- Relating to AI controlled, it has known issues of stupidly trying to cache lots of things from external drives...


But isn't Superfetch better than nothing at all?

eBoostr
...is an application which gives you Superfetch on XP.  In fact, it's actually better, because it's configurable:
Advantages of eBoostr:
- You can specify exclusion lists (works well with manual preloading, plus you can stop Superfetch from stupidly caching those 700MB AVI files)
- You can specify a cache size limit (so you won't get lots of HDD thrashing from RAM deallocation/allocation)

Disadvantages:
- Err, you have to install an application?
- The app isn't free... (but neither is Windows)

...and there, you have Superfetch for XP, and can make use of your mostly empty RAM.
Whilst wee're here, you may as well make use of eBoostr's exclusion list - I personally add *.avi, *.mkv (other video files etc), *.zip, *.rar, *.7z, *.iso, my Music and Video folders, removable drives, partitions with other OSes installed etc.

But can wee do better?


Side note: Hibernation?
If you're using a 32-bit Windows with 4+GB of RAM installed, you don't need to worry about this, since 32-bit can only address 4GB of memory.  However, if you're running 64-bit Windows with 4+GB of RAM, you may notice that you can no longer hibernate.  It so happens that Microsoft decided to stick a 4GB limit for hibernation, meaning that if you wish to use it, you're going to have to cap your addressable memory to 4GB.  If you like using hibernation, and really don't need all your RAM, you could consider adding the /maxmem=4096 switch to your boot.ini to cap the addressable memory to 4GB.  On my machine, with the switch, Windows detects 3.25GB of RAM installed.  (the amount your machine will detect will depend on various factors, such as the amount of video memory you have)

But anyways, back to optimising your RAM usage...



Disable Kernel Paging
This is a basic tweak which you should always apply, if you haven't disabled paging entirely, that is.  This registry edit stops Windows from offloading the kernel to your HDD.
Simply change the following key:
KEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\DisablePagingExecutive
^ Change the value to 1.
If you're confident, you can disable Windows' paging altogether...

Manual Preloading and RAMDisks
Advantages:
- _total_ control over what is preloaded
- can speed up some other operations
- static cache loads much faster than the dynamically generated cache of Superfetch (a RAM image is faster to load than seeking around the HDD looking for apps)
- there is NO HDD "thrashing" since things are statically loaded and never actually unloaded
- caching system is much simpler = less CPU overhead (though there isn't that much CPU overhead with automated solutions)
Disadvantages:
- ...total control implies that you have to manually set up everything (it's not an automated set-and-forget solution like Superfetch)
- not as efficient in terms of RAM usage as some things may be loaded twice into RAM (but if you have plenty of RAM, this shouldn't be an issue, right?)
- like above, since stuff is statically loaded, the cache doesn't dynamically deallocate if you start using GBs of RAM (though again, if you have plenty, you should be fine, right?)
- potential for some data loss, though if set up correctly, there won't be anything serious (see Fast Writes VS Reliability below)


Okay, the basic idea here is to use a RAMDisk.  A RAMDisk is basically a driver which allocates a bit of RAM which you can use as a drive to store files.  Obviously, RAM is insanely fast compared to reads/writes/seeks from a HDD, so you can see the benefits, however the issue with RAM is that it's cleared when you shut the system down.
Some RAMDisk drivers will save a snapshot of the RAMDisk at shutdown, then reload the image back at startup.  This does make your shutdown/startup times slightly slower, however reading/writing an image is pretty fast (since it's a sequencial read/write as opposed to random read/write where the HDD's slow seek times come into play).
Combine this with NTFS junction points, and you may have guessed how this can be utilized.


Fast Writes VS Reliability
One thing you may have noticed is that the RAMDisk image is only saved a system shutdown.  This means that writes to the RAMDisk are extremely fast, since you're writing directly to RAM.  On the other hand, if your system crashes, it won't have the opportunity to save the RAM image, thus you lose whatever changes have been made to the RAMDisk during the session.  Thus it wouldn't be wise to stick your Word documents on a RAMDisk, for example.
Most applications write settings to the registry, so a computer crash shouldn't cause any losses, since nothing's written to the RAMDisk, but for those that do write to a file in its own directory, you could lose updated settings in the rare instance that your computer crashes and you've updated some settings.

Temporary Storage
Whilst saving critical data to a RAMDisk isn't a smart idea, RAMDisks make excellent temporary storage mediums - another advantage of RAMDisks (they're also not bad for storing non critical data which get updated and need to be saved across sessions, such as the Prefetch cache).  I have two RAMDisks set up on my computer - one saves and loads an image at shutdown/startup - this is where my apps (and Prefetch folder) go, the other doesn't save/load anything - this is my temporary storage drive.  Since RAM is very fast for reads/writes, using a RAMDisk for temporary storage is quite a good idea if you ask me, since temporary files don't need to be kept in the long term, plus the RAMDisk will automatically clear out old stuff when you turn off the computer, not to mention that you won't ever get any fragmentation issues with RAMDisks.  This can especially speed up apps that like constantly writing/reading temporary data.  You can also stick stuff like your browser cache in the RAMDisk (if you've got a heap of space, you could even rip a CD to RAM, then burn the CD off RAM - buffer underruns practically will be non-existent plus you won't fragment and wear out the HDD :P).


Setting it up
Okay, enough discussion - here's the nitty gritty on doing it.
I use Superspeed's RAMDisk Plus as my RAMDisk driver - it's not free though (there are other RAMDisk applications available, though you'll have to try them out (I was mainly driven by XP x64 compatibility)) - also the interface is a little buggy, though you should be able to get around it.
Installing the application shouldn't be difficult.  After that's done, you'll need to consider the amount of RAM you want to allocate to RAMDisks (I guess it's theortically possible to dynamically size RAMDisks as you use the space up, but I haven't seen an application able to do this - if you do, please tell me :P).
On my setup, I have a 768MB disk for storing apps, and a 256MB one for temporary storage, so a total of 1GB allocated to RAMDisks.  Since I'm limited to 3.25GB of RAM, taking away 1GB leaves me with 2.25GB.  I have eBoostr using a 384MB cache, and considering that with kernel paging disabled, Windows XP64 with my background applications uses around ~384MB of RAM as well.  This leaves me with 1.5GB of free RAM, which leaves plenty of headroom for loading large apps without disturbing any caches.  You could probably quite easily be a bit more aggressive make your caches a fair bit larger though (I doubt you'll need 1.5GB of free RAM lying around, even with large-ish games).
Anyways, once you've got an idea of how you're going to use your RAM, continue reading:

Temp storage
In your RAMDisk application create a drive which you'll use for temporary storage, of appropriate size.  If given the option for a filesystem type, I'd suggest using FAT, and if you are given the option for a block/sector/cluster size, choose a small-ish one.  Since I use my temporary RAMDisk for some other purposes than just Windows temp files, I tick the "Create /temp folder" in my RAMDisk application, but this really isn't necessary (I generally like to extract the contents of archives, such as installer archives, to the temp RAMDisk).
After you've made your RAMDisk, tell Windows to use it.  Go to Start » Run » sysdm.cpl » Advanced » Environment Variables.  In the top list, locate the TEMP and TMP variables, and assign both to your RAMDisk - for example, if your RAMDisk is mounted at Z:\ , set the values of both TEMP and TMP variables to "Z:" (without quotes; I recommend dropping the trailing "\").  Do the same for the bottom listbox.  And that's it!
You might to also want to get some other applications to use the temp RAMDisk, ie your browser cache.
Note: some (badly written) applications (*cough* Adobe CS4 installer) will write large amounts of data to the temp directory.  Since you probably won't have an insanely large temp RAMDisk, you may have to temporarily switch the TEMP/TMP folders back to a HDD folder, run the app, and then switch it back.  In general, applications _shouldn't_ write lots of temporary data, and if they do, they should at least provide the option to change the directory to which the data is written to. (fortunately, Photoshop itself provides options for you to specify the "scratch disk")

Application storage
If your RAMDisk application supports RAM image saving & loading, create a RAMDisk of appropriate size which you'll store apps on, and don't forget to set the option to save/load a RAMDisk image.  I'd personally go for an NTFS filesystem (junctioning back to the HDD :P), but you could go for a FAT filesystem if you wish for performance.  If given option for a sector/cluster/block size, choose a small to medium-ish one.
Now just install your applications normally.  Once you've done so, copy the application's directory to your RAMDisk.  On the RAMDisk copy, I suggest deleting non-essential files (such as help/readme files) to save space.  If you chose an NTFS filesystem, you can also junction some rarely used directories back to the HDD.  For the HDD copy, rename it to something else - this will serve as a backup copy should your RAMDisk fail.  Now all that's left is to create an NTFS junction on your HDD which links to the directory you placed on the RAMDisk.  Now your application is permanently loaded in memory, for fast loading.
In terms of actual performance gains though, it will vary depending on each application.  The key concept is to try to reduce the number of HDD seeks.  Thus, if your application is reading lots of stuff from the system directory when it loads, this probably doesn't help too much (since it's still reading lots of stuff from the HDD), however you can also load some other things into the RAMDisk to help.  One candidate would be the Prefetch folder (%windir%\Prefetch), which isn't of critical importance, but having it on RAM does save a read/write during app loading.  Another candidate could be the %windir%\assembly and %windir%\Microsoft.NET directories, if you have enough RAM, and use .NET based applications frequently - I haven't tried this myself though.

EDIT: should probably add, installing directly to the RAMDisk should be faster than using junctions (since the request is made directly to the RAMDisk as opposed to the HDD), so if you are able to do this, I recommend it (you can always make a backup copy on the HDD should you think the RAMDisk might fail).


eBoostr
If you're using this in conjunction with eBoostr, I suggest you add an exception to eBoostr's list, not to cache anything on the RAMDisks.  You can go further and exclude each junctioned directory, to make sure eBoostr isn't caching stuff on the RAMDisk.




I hope this guide will be of some use to people.  If you have any suggestions/criticisms, please feel free to leave them.
(This post was last modified: 06/01/2009 03:51 AM by ZiNgA BuRgA.)
06/01/2009 03:31 AM
Visit this user's website Find all posts by this user Quote this message in a reply
feinicks
One day... we Fly...

Posts: 6,124.6050
Threads: 531
Joined: 27th Mar 2008
Reputation: 2.35695
E-Pigs: 210817.3958
Offline
Post: #2
RE: How to make use of lots of free RAM on XP
nice read... of course much of it is already applicable even in Windows 7.

◄◄••• 天使たちの夢か? •••►►

[Image: ewualizer.gif]
My works!
06/01/2009 06:04 AM
Find all posts by this user Quote this message in a reply
Slushba132
BustyLoli-Chan

Posts: 3,125.3993
Threads: 508
Joined: 20th Feb 2008
Reputation: -8.27558
E-Pigs: 73.1299
Offline
Post: #3
RE: How to make use of lots of free RAM on XP
... 4 gigs of ram?
you will never use more than 3 without 64bit...

I find it sad really

06/01/2009 08:34 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Assassinator
...

Posts: 6,646.6190
Threads: 176
Joined: 24th Apr 2007
Reputation: 8.53695
E-Pigs: 140.8363
Offline
Post: #4
RE: How to make use of lots of free RAM on XP
Slushba132 Wrote:... 4 gigs of ram?
you will never use more than 3 without 64bit...

I find it sad really

And then there's these people (idiots) who thinks anything less than 8GB is not enough. I find that extremely sad.

But consider the price these days, it's hardly a heavy investment to get 4GB. Better price/value ratio than getting 2GB. (While 4»8 doesn't improve in price/value ratio).

So 4GB is alright. 8GB is a waste of money.
06/01/2009 11:32 AM
Find all posts by this user Quote this message in a reply
feinicks
One day... we Fly...

Posts: 6,124.6050
Threads: 531
Joined: 27th Mar 2008
Reputation: 2.35695
E-Pigs: 210817.3958
Offline
Post: #5
RE: How to make use of lots of free RAM on XP
not to an enthusiast!

◄◄••• 天使たちの夢か? •••►►

[Image: ewualizer.gif]
My works!
06/01/2009 11:58 AM
Find all posts by this user Quote this message in a reply
Assassinator
...

Posts: 6,646.6190
Threads: 176
Joined: 24th Apr 2007
Reputation: 8.53695
E-Pigs: 140.8363
Offline
Post: #6
RE: How to make use of lots of free RAM on XP
feinicks Wrote:not to an enthusiast!

Tell me how you could possibly use up 8GB of RAM.... Realistically. So compressing 5 files and encoding 4 movies and running 2 games simultaneously does not count.

Ok, getting DDR3 RAM or something (which enthusiasts might do) at least does increase your performance, even though price/performance is way off. But getting 8GB of RAM doesn't really do anything besides for letting you show off maybe.

It's like the same as getting a 1500W power supply.
(This post was last modified: 06/01/2009 12:09 PM by Assassinator.)
06/01/2009 12:06 PM
Find all posts by this user Quote this message in a reply
feinicks
One day... we Fly...

Posts: 6,124.6050
Threads: 531
Joined: 27th Mar 2008
Reputation: 2.35695
E-Pigs: 210817.3958
Offline
Post: #7
RE: How to make use of lots of free RAM on XP
Assassinator Wrote:
feinicks Wrote:not to an enthusiast!

Tell me how you could possibly use up 8GB of RAM.... Realistically. So compressing 5 files and encoding 4 movies and running 2 games simultaneously does not count.

Ok, getting DDR3 RAM or something (which enthusiasts might do) at least does increase your performance, even though price/performance is way off. But getting 8GB of RAM doesn't really do anything besides for letting you show off maybe.

It's like the same as getting a 1500W power supply.

really... you're missing the point. I'm simply saying that to an enthusiast, its not about logic. Its all about MORE! For instance the i7 960 (?) is so freaking expensive, but some people who want the latest and the greatest will go any distance to obtain it. Its the same with new graphics cards. When they are new, the cost/value factor is a tribute to inefficiency, yet some people will even pre-book the cards!

◄◄••• 天使たちの夢か? •••►►

[Image: ewualizer.gif]
My works!
06/01/2009 12:24 PM
Find all posts by this user Quote this message in a reply
squee666
Grand Warlock

Posts: 3,566.4225
Threads: 351
Joined: 4th May 2007
Reputation: 12.17831
E-Pigs: 555.8899
Offline
Post: #8
RE: How to make use of lots of free RAM on XP
wait until XDR ram properly gets released now that stupid speed

[Image: IuZelj2.png]
Spoiler for anime watched:
[Image: squee666.jpg]
06/01/2009 12:39 PM
Find all posts by this user Quote this message in a reply
MysterySword
Omnipotent Presence

Posts: 396.4394
Threads: 29
Joined: 19th Oct 2008
Reputation: 4.35811
E-Pigs: 38.0895
Offline
Post: #9
RE: How to make use of lots of free RAM on XP
I have 1GB of RAM on my PC (running XP with some memory hogs not being used, it runs really fast). msconfig really helps for disabling programs and some useless services from running at startup, and click on the desktop, hit the Windows and Pause Break button at the same time, go to the Advanced tab, and click Settings under Performance, and disable all in the Visual Effects tab except for the last 3.

Realistically, 8GB of RAM is almost useless for this time, but in the near future, there will probably be things which require around 8GB of RAM (Assassins Creed for PC recommends 3GB of RAM). Now of course, combined with the best Graphics card and processor for the time, that PC would last a while longer than say a PC with 2GB of RAM.
(This post was last modified: 06/01/2009 12:56 PM by MysterySword.)
06/01/2009 12:52 PM
Find all posts by this user Quote this message in a reply
Slushba132
BustyLoli-Chan

Posts: 3,125.3993
Threads: 508
Joined: 20th Feb 2008
Reputation: -8.27558
E-Pigs: 73.1299
Offline
Post: #10
RE: How to make use of lots of free RAM on XP
everyone missed my point... unless you have 64 bit 3 gigs of ram is all the computer has the capability to use

06/01/2009 04:19 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

 Quick Theme: