Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Swap file on RAM disk?

Swap file on RAM disk?

Scheduled Pinned Locked Moved The Lounge
csharpperformancequestion
20 Posts 11 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jim Crafton
    wrote on last edited by
    #1

    I recently got a new machine at home (woot!). It has 1GB Ram. So I was wondering, what would happen if I were to: 1) reduce the swap file size to 512MB 2) create a RAM Drive and then set the swap file to exist on the RAM drive. Is this even possible on Win 2K/XP? Has anyone ever tried it? Does it really result in better performance results? ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

    J M V P D 7 Replies Last reply
    0
    • J Jim Crafton

      I recently got a new machine at home (woot!). It has 1GB Ram. So I was wondering, what would happen if I were to: 1) reduce the swap file size to 512MB 2) create a RAM Drive and then set the swap file to exist on the RAM drive. Is this even possible on Win 2K/XP? Has anyone ever tried it? Does it really result in better performance results? ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

      J Offline
      J Offline
      James R Twine
      wrote on last edited by
      #2

      I would just leave the whole 1GB of RAM available to the OS.  Why?  Because I would be more interested in reducing swapping rather than (likely) increasing it and improving its performance.    Peace! -=- James


      If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
      Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
      DeleteFXPFiles & CheckFavorites

      J 1 Reply Last reply
      0
      • J James R Twine

        I would just leave the whole 1GB of RAM available to the OS.  Why?  Because I would be more interested in reducing swapping rather than (likely) increasing it and improving its performance.    Peace! -=- James


        If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
        Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
        DeleteFXPFiles & CheckFavorites

        J Offline
        J Offline
        Jim Crafton
        wrote on last edited by
        #3

        Well I would have thought that too. Except, with 1 GB of RAM why should ANY swapping occur? I can check the TaskManager and it reports only about 15-20% of physical RAM being used, yet if I minimize a program like Lotus BlNotes, or Thunderbird[^], do something else for a while, and then return to it, I still see a pause, creak, and hear the HD rev around while it lok into RAM). I would expect that a sysads stuff up (presumably bringing relevant data that was dumped to swap bactem with 1 GB or RAM, a 3.0 GHz P4 HT'd CPU, and a mobo with 800mhz FSB, to be just about instantaneous when switching between apps. ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

        D D J 3 Replies Last reply
        0
        • J Jim Crafton

          I recently got a new machine at home (woot!). It has 1GB Ram. So I was wondering, what would happen if I were to: 1) reduce the swap file size to 512MB 2) create a RAM Drive and then set the swap file to exist on the RAM drive. Is this even possible on Win 2K/XP? Has anyone ever tried it? Does it really result in better performance results? ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

          M Offline
          M Offline
          Mario M 0
          wrote on last edited by
          #4

          I have 1 GB RAM too and i reduced the swap file to 0. so 0 fragmentation. Now i don't wait for hard disk, hard disk does wait for me :laugh: . Try it, your computer looks faster. Swap file on windows should be forbidden. Make me :zzz:

          D 1 Reply Last reply
          0
          • J Jim Crafton

            I recently got a new machine at home (woot!). It has 1GB Ram. So I was wondering, what would happen if I were to: 1) reduce the swap file size to 512MB 2) create a RAM Drive and then set the swap file to exist on the RAM drive. Is this even possible on Win 2K/XP? Has anyone ever tried it? Does it really result in better performance results? ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

            V Offline
            V Offline
            Vikram A Punathambekar
            wrote on last edited by
            #5

            I've never tried it, but I don't understand your post. Shouldn't you try to reduce swapping, as has been pointed out? Also, what's the point of keeping the swap file in your RAM, even if it's possible? :confused: Vikram.


            http://www.geocities.com/vpunathambekar "Argue for your limitations, and sure enough, they're yours." – Richard Bach, "Illusions". "I think the internet has been online for too long." – Joesox.

            1 Reply Last reply
            0
            • J Jim Crafton

              Well I would have thought that too. Except, with 1 GB of RAM why should ANY swapping occur? I can check the TaskManager and it reports only about 15-20% of physical RAM being used, yet if I minimize a program like Lotus BlNotes, or Thunderbird[^], do something else for a while, and then return to it, I still see a pause, creak, and hear the HD rev around while it lok into RAM). I would expect that a sysads stuff up (presumably bringing relevant data that was dumped to swap bactem with 1 GB or RAM, a 3.0 GHz P4 HT'd CPU, and a mobo with 800mhz FSB, to be just about instantaneous when switching between apps. ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

              D Offline
              D Offline
              Dean Michaud
              wrote on last edited by
              #6

              Jim Crafton wrote: Well I would have thought that too. Except, with 1 GB of RAM why should ANY swapping occur? Well, I know it is a game, but when I am playing Everquest 2 I notice that now and again the game does go over the 1GB of physical memory I have; sometimes reaching as high as 1.3GB. I am not sure why it gobbles up so much memory, but I have a feeling the game is designed in such a way as to take advantage of anything and everything you have to throw at it hardware-wise. Sadly, I've contemplated slapping another 3GB into the box. : Dean Michaud

              1 Reply Last reply
              0
              • M Mario M 0

                I have 1 GB RAM too and i reduced the swap file to 0. so 0 fragmentation. Now i don't wait for hard disk, hard disk does wait for me :laugh: . Try it, your computer looks faster. Swap file on windows should be forbidden. Make me :zzz:

                D Offline
                D Offline
                Daniel Turini
                wrote on last edited by
                #7

                Mario M wrote: Try it, your computer looks faster. Are you sure? Have you measured it? Don't forget that the pagefile is often used for CreateFileMapping, passing an INVALID_HANDLE_VALUE as the hFile. IIRC, this will fail if your swap file does not have the required size (and that does not mean that it will be used, but it must have the right file size). In other words, some softwares may not work if the pagefile is 0 bytes. I see dead pixels Yes, even I am blogging now!

                1 Reply Last reply
                0
                • J Jim Crafton

                  Well I would have thought that too. Except, with 1 GB of RAM why should ANY swapping occur? I can check the TaskManager and it reports only about 15-20% of physical RAM being used, yet if I minimize a program like Lotus BlNotes, or Thunderbird[^], do something else for a while, and then return to it, I still see a pause, creak, and hear the HD rev around while it lok into RAM). I would expect that a sysads stuff up (presumably bringing relevant data that was dumped to swap bactem with 1 GB or RAM, a 3.0 GHz P4 HT'd CPU, and a mobo with 800mhz FSB, to be just about instantaneous when switching between apps. ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

                  D Offline
                  D Offline
                  Daniel Turini
                  wrote on last edited by
                  #8

                  Jim Crafton wrote: swap bactem with 1 GB or RAM, a 3.0 GHz P4 HT'd CPU, and a mobo with 800mhz FSB, to be just about instantaneous when switching between apps. So, use Linux. For those who have a good Linux machine, try the following experience: open an average sized program once (e.g., Firefox or some other browser). Close it. Open it again. Do this in Linux and do this in Windows. The speed difference is astonishing. I see dead pixels Yes, even I am blogging now!

                  J A 2 Replies Last reply
                  0
                  • J Jim Crafton

                    Well I would have thought that too. Except, with 1 GB of RAM why should ANY swapping occur? I can check the TaskManager and it reports only about 15-20% of physical RAM being used, yet if I minimize a program like Lotus BlNotes, or Thunderbird[^], do something else for a while, and then return to it, I still see a pause, creak, and hear the HD rev around while it lok into RAM). I would expect that a sysads stuff up (presumably bringing relevant data that was dumped to swap bactem with 1 GB or RAM, a 3.0 GHz P4 HT'd CPU, and a mobo with 800mhz FSB, to be just about instantaneous when switching between apps. ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

                    J Offline
                    J Offline
                    James R Twine
                    wrote on last edited by
                    #9

                    Because if I understand it correctly, Windows will always try to swap out "unused" portions of memory.  Now, why does it do this?  To avoid unnecesary management/mapping of physical memory?  To ensure that all possible physical memory is available at all times?  I dunno.    I do know that APIs exist to reserve/lock physical memory, so likely someone anticipated unnecessary swapping taking place. :)    Peace! -=- James


                    If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
                    Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
                    DeleteFXPFiles & CheckFavorites

                    1 Reply Last reply
                    0
                    • J Jim Crafton

                      I recently got a new machine at home (woot!). It has 1GB Ram. So I was wondering, what would happen if I were to: 1) reduce the swap file size to 512MB 2) create a RAM Drive and then set the swap file to exist on the RAM drive. Is this even possible on Win 2K/XP? Has anyone ever tried it? Does it really result in better performance results? ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

                      P Offline
                      P Offline
                      peterchen
                      wrote on last edited by
                      #10

                      As I understand, creating a RAM Disk doesn't guarantee it isn't swapped at all. However, I once moved a VC project ot ram disk (sources and temp files only, not the "general" includes), and compile there. Almost factor of 2 faster.


                      Pandoras Gift #44: Hope. The one that keeps you on suffering.
                      aber.. "Wie gesagt, der Scheiss is' Therapie"
                      boost your code || Fold With Us! || sighist | doxygen

                      1 Reply Last reply
                      0
                      • J Jim Crafton

                        I recently got a new machine at home (woot!). It has 1GB Ram. So I was wondering, what would happen if I were to: 1) reduce the swap file size to 512MB 2) create a RAM Drive and then set the swap file to exist on the RAM drive. Is this even possible on Win 2K/XP? Has anyone ever tried it? Does it really result in better performance results? ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

                        D Offline
                        D Offline
                        David Crow
                        wrote on last edited by
                        #11

                        I used to do something similar to this with ramdrive.sys back with 16-bit windows. I would create a 1MB RAM drive and point the TEMP and TMP environment variables to it. Compiles were blazingly fast.


                        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                        J 1 Reply Last reply
                        0
                        • D David Crow

                          I used to do something similar to this with ramdrive.sys back with 16-bit windows. I would create a 1MB RAM drive and point the TEMP and TMP environment variables to it. Compiles were blazingly fast.


                          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                          J Offline
                          J Offline
                          Jim Crafton
                          wrote on last edited by
                          #12

                          DavidCrow wrote: point the TEMP and TMP environment variables to it That's another idea: Is it possible in Win2k/XP to have the temp directories somewhere other than their default locations? For example could you remap to "c:\winnt\Temp" or "c:\Documents and Settings\[user name]\Local Settings\Temp" to point to some other dir? ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

                          D 1 Reply Last reply
                          0
                          • D Daniel Turini

                            Jim Crafton wrote: swap bactem with 1 GB or RAM, a 3.0 GHz P4 HT'd CPU, and a mobo with 800mhz FSB, to be just about instantaneous when switching between apps. So, use Linux. For those who have a good Linux machine, try the following experience: open an average sized program once (e.g., Firefox or some other browser). Close it. Open it again. Do this in Linux and do this in Windows. The speed difference is astonishing. I see dead pixels Yes, even I am blogging now!

                            J Offline
                            J Offline
                            Jim Crafton
                            wrote on last edited by
                            #13

                            Daniel Turini wrote: use Linux Uhhm, ... wait for it... No :) ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

                            1 Reply Last reply
                            0
                            • J Jim Crafton

                              DavidCrow wrote: point the TEMP and TMP environment variables to it That's another idea: Is it possible in Win2k/XP to have the temp directories somewhere other than their default locations? For example could you remap to "c:\winnt\Temp" or "c:\Documents and Settings\[user name]\Local Settings\Temp" to point to some other dir? ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

                              D Offline
                              D Offline
                              David Crow
                              wrote on last edited by
                              #14

                              Jim Crafton wrote: Is it possible in Win2k/XP to have the temp directories somewhere other than their default locations? Not only is it possible, that's what I have done on my machine. By default, they both point to the C:\Documents and Settings\[user name]\Local Settings\Temp folder. I changed them to be C:\Winnt\Temp instead.


                              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                              J 1 Reply Last reply
                              0
                              • D David Crow

                                Jim Crafton wrote: Is it possible in Win2k/XP to have the temp directories somewhere other than their default locations? Not only is it possible, that's what I have done on my machine. By default, they both point to the C:\Documents and Settings\[user name]\Local Settings\Temp folder. I changed them to be C:\Winnt\Temp instead.


                                "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                                J Offline
                                J Offline
                                Jim Crafton
                                wrote on last edited by
                                #15

                                Ahh, so if a RAM disk were made for this, that might make a difference in perf, at least for stuff like compiling, etc ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

                                1 Reply Last reply
                                0
                                • J Jim Crafton

                                  I recently got a new machine at home (woot!). It has 1GB Ram. So I was wondering, what would happen if I were to: 1) reduce the swap file size to 512MB 2) create a RAM Drive and then set the swap file to exist on the RAM drive. Is this even possible on Win 2K/XP? Has anyone ever tried it? Does it really result in better performance results? ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

                                  C Offline
                                  C Offline
                                  cmk
                                  wrote on last edited by
                                  #16

                                  I did a search on this a while ago. The consensus seems to be: - windows will always swap regardless of how much memory you have. - windows doesn't like to boot with a page file on a disk that doesn't exist - there are work arounds, but evidently there isn't much performance increase - it is worthwhile putting a temp dir on a ram disk so long as you are prepared to loose all the data on reboot - this is mainly an issue if you move the IE temp dir to the ramdisk where cookies you want to keep (that auto-login) will be erased on reboot. ...cmk Save the whales - collect the whole set

                                  1 Reply Last reply
                                  0
                                  • J Jim Crafton

                                    I recently got a new machine at home (woot!). It has 1GB Ram. So I was wondering, what would happen if I were to: 1) reduce the swap file size to 512MB 2) create a RAM Drive and then set the swap file to exist on the RAM drive. Is this even possible on Win 2K/XP? Has anyone ever tried it? Does it really result in better performance results? ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

                                    J Offline
                                    J Offline
                                    Joey Bloggs
                                    wrote on last edited by
                                    #17

                                    HyperDrive III http://www.hyperos2002.com/?affid=19129[^] sort of does what you want but it doesn't share main memory...

                                    1 Reply Last reply
                                    0
                                    • D Daniel Turini

                                      Jim Crafton wrote: swap bactem with 1 GB or RAM, a 3.0 GHz P4 HT'd CPU, and a mobo with 800mhz FSB, to be just about instantaneous when switching between apps. So, use Linux. For those who have a good Linux machine, try the following experience: open an average sized program once (e.g., Firefox or some other browser). Close it. Open it again. Do this in Linux and do this in Windows. The speed difference is astonishing. I see dead pixels Yes, even I am blogging now!

                                      A Offline
                                      A Offline
                                      Andrew Peace
                                      wrote on last edited by
                                      #18

                                      Daniel Turini wrote: For those who have a good Linux machine, try the following experience: open an average sized program once (e.g., Firefox or some other browser). Close it. Open it again. On Windows, it opens almost immediately the second time I load it, hence I'm not sure what the point was? -- Andrew.

                                      D 1 Reply Last reply
                                      0
                                      • A Andrew Peace

                                        Daniel Turini wrote: For those who have a good Linux machine, try the following experience: open an average sized program once (e.g., Firefox or some other browser). Close it. Open it again. On Windows, it opens almost immediately the second time I load it, hence I'm not sure what the point was? -- Andrew.

                                        D Offline
                                        D Offline
                                        Daniel Turini
                                        wrote on last edited by
                                        #19

                                        Andrew Peace wrote: On Windows, it opens almost immediately the second time I load it, hence I'm not sure what the point was? :sigh: People are so religious about this topic that it's hard to make any statement that does not start a flame war. Just to be clear: I never said that Windows is a piece of crap OS created by Micro$oft and that Linux is da 1337 software. Sorry for the rant, but I just received 5 flaming e-mails about how easier Windows is than Linux and about driver support. Ok. Now, for your answer. I bet you never tried it in Linux, otherwise you'd understand. Download a Knoppix CD and try it. In Linux, you'd not use the word "almost". Even on a 650Mhz machine with 256Mb RAM. My point was that Linux seems to take better advantage of huge ammounts of memory than Windows XP when it comes to avoid swapping. It's clearly faster. I see dead pixels Yes, even I am blogging now!

                                        A 1 Reply Last reply
                                        0
                                        • D Daniel Turini

                                          Andrew Peace wrote: On Windows, it opens almost immediately the second time I load it, hence I'm not sure what the point was? :sigh: People are so religious about this topic that it's hard to make any statement that does not start a flame war. Just to be clear: I never said that Windows is a piece of crap OS created by Micro$oft and that Linux is da 1337 software. Sorry for the rant, but I just received 5 flaming e-mails about how easier Windows is than Linux and about driver support. Ok. Now, for your answer. I bet you never tried it in Linux, otherwise you'd understand. Download a Knoppix CD and try it. In Linux, you'd not use the word "almost". Even on a 650Mhz machine with 256Mb RAM. My point was that Linux seems to take better advantage of huge ammounts of memory than Windows XP when it comes to avoid swapping. It's clearly faster. I see dead pixels Yes, even I am blogging now!

                                          A Offline
                                          A Offline
                                          Andrew Peace
                                          wrote on last edited by
                                          #20

                                          Daniel Turini wrote: People are so religious about this topic that it's hard to make any statement that does not start a flame war. Just to be clear: I never said that Windows is a piece of crap OS created by Micro$oft and that Linux is da 1337 software. Sorry for the rant, but I just received 5 flaming e-mails about how easier Windows is than Linux and about driver support. People do indeed get religious about this topic. I wasn't trying to flame you, I was simply asking if I'd missed something as I don't experience the Windows behaviour that you described. Daniel Turini wrote: I bet you never tried it in Linux, otherwise you'd understand. Download a Knoppix CD and try it. I've used Linux almost every day for the last six months, and on a semi-regular basis before then. It certinaly can be fast for some applications, though I must say in general I find it to be slower than my Windows installation. (This isn't necessarily a Linux issue but more a driver issue - I believe my graphics driver isn't a particularly good one, I have a Radeon Mobility 7500 (I think) card.) In terms of the particular speed metric you mention, I would have said that the systems were roughly equal. I would argue that Linux will load Firefox more quickly the first time you load it, hwoever. However, I'm not sure how fair or unfair such a comparison is, since Fedora Core 2 at least seems to come with some kind of binary prelinking operation scheduled to occur daily, which (and I've never really investigated exactly what it's doing) may spoil the results, even if only by not taking into account the massive slow down whilst this operation is taking place. -- Andrew.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups