Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Why is swap space "required" even with a system with tons of RAM?  (Read 2607 times)

0 Members and 1 Guest are viewing this topic.

DaveLembke

    Topic Starter


    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
I was given this question today by a coworker. And it actually stumped me because I felt that he has a valid point given his setup / computer usage needs. And Windows 7 has a minimum swap space requirement of a single drive to have at least some swap space enabled vs totally disabling paging/swap space.

Quote
Why is swap space required even with a system with tons of RAM? ( Isn't swap space really a thing of the past for inadequately built computers, in which modern computers with plenty of system RAM don't really need this feature? He stated that sure you would need swap space if say it was to be a gaming system and it only came with 4GB RAM, but based on application of the system you can be almost running it wastefully putting write cycle wear on your SSD configured to use swap space just because its configured to be available by default, but not because it actually needs the swap space.)

His statement was that he has a system with 8GB of RAM and his system has a SSD, and 12GB of his 240GB SSD is wasted as he stated for SWAP space. Sure he is able to go in and reduce the swap space to just about none, but Windows 7 64-bit doesn't allow for you to set it to absolute none. The fact that he isn't a gamer and this system is used mainly for e-mail, Netflix, and web surfing his specs of a Core i5 with 8GB RAM and 240GB SSD are more than plenty for his usage.

He states that according to his desktop memory gadget that he never sees more than 3.5GB of the 8GB DDR3 RAM in use. And even after setting his swap space to just about none he hasn't noticed any loss of performance but he has noticed that there is less LED activity for the SSD, so he is forcing Windows 7 64-bit to juggle it all in system RAM.

I personally have yet to have a system with enough memory to consider turning swap off. If anything I have gained performance by putting swap designation on a different hard drive to that of the drive that a video game is installed and running on to avoid the game trying to load map files and textures at the same time that the system is performing the read/write to drive memory swap paging juggle and have a performance advantage.


patio

  • Moderator


  • Genius
  • Maud' Dib
  • Thanked: 1769
    • Yes
  • Experience: Beginner
  • OS: Windows 7
Re: Why is swap space "required" even with a system with tons of RAM?
« Reply #1 on: August 09, 2015, 10:04:57 AM »
Only reason that comes to my mind is that the OS was designed that way so it could accomodate all kinds of PC setups...including those with minimal RAM...
" Anyone who goes to a psychiatrist should have his head examined. "

Allan

  • Moderator

  • Mastermind
  • Thanked: 1260
  • Experience: Guru
  • OS: Windows 10
Re: Why is swap space "required" even with a system with tons of RAM?
« Reply #2 on: August 09, 2015, 11:06:12 AM »
Correct - Windows was designed to page and it always will, regardless of the pagefile setting.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: Why is swap space "required" even with a system with tons of RAM?
« Reply #3 on: August 09, 2015, 11:17:13 AM »
Not having a pagefile means that pages that are marked discardable never will be (since there is nowhere else to put it); it also means that large allocations will always require a physical memory commit charge, since virtual memory is, in some sense, disabled. Normally if a program allocates, say, 1GB, that gets allocated as a virtual allocation, what this means is that no physical or pagefile memory is actually allocated at all until that program starts changing the RAM Block it allocated. This is of course, how Virtual Memory works. In this case, the pages of the 1GB block are marked as blank. In the pagetable these pages are considered "swapped out" even though they don't actually have any data. Without a pagefile, this cannot happen; if a program allocates 1GB, that full, empty block of memory will be committed to the backing store, which in this case would be Physical Memory.

I believe memory-mapped files work different as well, and require a more significant physical memory allocation than they do when there is a pagefile backing store.

I have 32GB of Memory myself. For a time I disabled the pagefile thinking that even with the above reasons I won't have a commit charge of 32GB.

Well, I eventually did. Merely keeping a few browser windows and other applications open for a time eventually caused the fun stuff to happen where fonts started showing up as the System font and window decorations weren't painting properly. and programs crashed left and right.

With a pagefile in that situation there is a lot of thrashinmg of my second disk but nothing outright crashes, which I prefer, since I can just close the applications I don't need open while preventing data loss.
I was trying to dereference Null Pointers before it was cool.

DaveLembke

    Topic Starter


    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Why is swap space "required" even with a system with tons of RAM?
« Reply #4 on: August 09, 2015, 11:28:18 AM »
Thanks for all the responses. Printed this out to share with him tomorrow.

I forgot about the trash management of data as BC stated. Also didnt know that Windows really needs paging/swap space as its original design relies of it to maintain its healthy run state.

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Why is swap space "required" even with a system with tons of RAM?
« Reply #5 on: August 09, 2015, 11:35:11 AM »
Linux also "needs" swap space.
http://askubuntu.com/questions/398258/do-i-need-a-swap-partition
Quote
A swap partition of 4GB (8GB is not required) will make your system much more stable and is highly recommended. When the system runs out of free memory, memory contents will be exchanged into the swap partition, and if there is no swap partition, the system crawls to a halt. Hibernation also needs swap to function.

Windows 8.1 can have a page file.
http://superuser.com/questions/905022/is-it-possible-to-make-a-swap-spacepartition-in-windows-8-1-like-linux

This is about Windows 7
http://windows.microsoft.com/en-us/windows/change-virtual-memory-size#1TC=windows-7
Quote
If you receive warnings that your virtual memory is low, you'll need to increase the minimum size of your paging file. Windows sets the initial minimum size of the paging file equal to the amount of random access memory (RAM) installed on your computer, and the maximum size equal to three times the amount of RAM installed on your computer. If you see warnings at these recommended levels, then increase the minimum and maximum sizes.


patio

  • Moderator


  • Genius
  • Maud' Dib
  • Thanked: 1769
    • Yes
  • Experience: Beginner
  • OS: Windows 7
Re: Why is swap space "required" even with a system with tons of RAM?
« Reply #6 on: August 09, 2015, 06:01:35 PM »
So i guess i over-simplified it...
" Anyone who goes to a psychiatrist should have his head examined. "

DaveLembke

    Topic Starter


    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Why is swap space "required" even with a system with tons of RAM?
« Reply #7 on: August 10, 2015, 12:02:56 PM »
Quote
So i guess i over-simplified it...

Anything can be over simplified. The answer you gave was to the point and correct.  ;D