Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using PostgreSQL and I want to explicitly place a database with 4 gb of data in memory. I have read a lot of forums discussing whether this is a good idea and I have decided that I want to give it a try. I am using a Vista machine. I currently have only 2 gb of ram.

I have tried a lot of ramdisks and my problem is that none (that I have found) works when I assign more memory than I have. I, of course, want to use the harddisk for swapping in this case. I know the performance penalty and I believe I will still come out better. My question is whether any of you know of such ramdisk software?

share|improve this question

migrated from Aug 31 '09 at 5:42

This question came from our site for professional and enthusiast programmers.

For what it's worth, I think you'll get significantly worse performance with a RAM-starved swapping ramdisk than you would from Postgres managing its own memory, because the ramdisk won't have any context-sensitive information by which to optimize the disk accesses. Also, if you plan on allowing your ramdisk to swap, you might not be any better off than if you just configured a large Windows swapfile and configured Postgres to use a lot of RAM. – rob Dec 8 '09 at 1:41
if i read this correctly, you want to create a RAM disk larger than physical memory installed in your sytem. this like squaring the circle :) try this: – Molly7244 Dec 8 '09 at 3:09
up vote 5 down vote accepted

Part of your problem may not be so much that it won't swap. If I remember correctly, the 4 GB address space is split in half on Vista 32-bit (which I assume you're using from the behaviour specified), so each application has 2 GB and the kernel and drivers have the other 2 GB.

That means it's probably not possible (without workarounds) to get more than 2 GB into a ramdisk on Vista 32-bit. On 64-bit you would have far more space and be restricted only to how much swap you had available.

Have a look here.

share|improve this answer
Thanks a lot, that makes perfect sense. I wonder then, whether ramdisk software to undertake this on Vista 64-bit exists? I could easily get Vista 64-bit, though I am dependent on a laptop so getting more than 4 gb of ram would be a problem I believe. – David Aug 30 '09 at 23:51
I would imagine ramdisk software for Vista 64-bit would be available. Just make sure it's definitely 64-bit: if it's 32-bit, you'll still have the 2 GB limitation. – Matthew Iselin Aug 31 '09 at 0:40
This is not the case. PAE has been around for years. See for example, – ChrisInEdmonton Sep 2 '09 at 18:20
@ChrisInEdmonton: PAE merely extends the physical address space. Virtual addresses are still 32 bits wide, therefore there's still the 4 GB limitation. Vista splits that in half (with a boot flag it can split 3 GB / 1 GB). – Matthew Iselin Sep 3 '09 at 22:32
And reading about that software: you'll probably find that it uses a kernel-mode driver to allocate the ramdisk's physical memory (in full), then maps pages in and out of the 32-bit virtual address space as they're needed. – Matthew Iselin Sep 3 '09 at 22:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .