Author Topic: Is disabling win7 swapfile dangerous?  (Read 1066 times)

0 Members and 1 Guest are viewing this topic.

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4268
  • Country: gb
  • Doing electronics since the 1960s...
Is disabling win7 swapfile dangerous?
« on: October 08, 2024, 06:36:36 am »
This is recommended for machines which want to minimise SSD wear. Lots of people recommend it for winXP, which seems to trash SSDs faster than anything else - see here

https://www.eevblog.com/forum/programming/windows-inter-app-messaging-and-32-bit-apps-under-win7-64/

But surely it should apply to any SSD application.

The obvious gotcha is that you need enough RAM for the worst case situation. But how can that be determined? For example would a machine running win7-64 in 4GB RAM be "safe" when the perf monitor is showing just 1.5GB being used? I know some apps leak memory...
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6869
  • Country: ro
Re: Is disabling win7 swapfile dangerous?
« Reply #1 on: October 08, 2024, 07:40:23 am »
I used to disable the Windows swap all the time, even with WinXP, before the SSD.  Did the same with WinXP, Win7, Win10.  Don't recall any problems.

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4268
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is disabling win7 swapfile dangerous?
« Reply #2 on: October 08, 2024, 09:21:47 am »
It seems to be a complex topic because the swapfile is also used for other stuff e.g. inter process comms!
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline Postal2

  • Frequent Contributor
  • **
  • Posts: 731
  • Country: ru
Re: Is disabling win7 swapfile dangerous?
« Reply #3 on: October 08, 2024, 10:19:50 am »
.... I know some apps leak memory...
You can't just disable swap-file, because it dramatically reduces reliability - that's where everything that leaks is dumped. You just need to install another SSD, possibly switched to SLC (but not necessarily), and direct swap-file to it.

You can use your previous SSDs, which were the main ones and failed, as swap-file.

I haven't tried it, but I suspect that setting the swap-file size to a deliberately large size will increase reliability.
« Last Edit: October 08, 2024, 10:42:41 am by Postal2 »
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4205
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Is disabling win7 swapfile dangerous?
« Reply #4 on: October 08, 2024, 01:45:09 pm »
What is this pc used for, fairly static and light stuff or full applications and browsers?

Pagefile is important to keep things going when programs ask for memory but don't use it (chrome).
If you don't have it on, all memory will be allocated and there is a hard limit. Things will crash if you hit this limit, because nobody checks if malloc returns null.
For example, my 32 GB RAM laptop currenty has 17 GB of real memory used, and 24 GB in pagefile!

It is also used for fault dumps.. anyway I would recommend not messing with it unless you are absolutely certain you have enough physical memory to handle peak load and no programs depend on it.
 
The following users thanked this post: thm_w, peter-h

Offline The Soulman

  • Super Contributor
  • ***
  • Posts: 1042
  • Country: nl
  • The sky is the limit!
Re: Is disabling win7 swapfile dangerous?
« Reply #5 on: October 08, 2024, 01:57:40 pm »
Back in the day I had a computer with a intel robson 512MB SLC memory module installed, I ran it without the intel software (that would use as a "smart" cache for the hdd) but
instead used it as another drive to have the swap-file on and some other stuff)

Later upgraded to a 2GB module and had several volumes, including one in raid1 with a ram-disk, using that for swap-file would cause "unexpected behavior".

Edit: Forgot to mention this was on xp 64bit and 4gb ram.
« Last Edit: October 08, 2024, 02:01:15 pm by The Soulman »
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 6875
  • Country: ca
Re: Is disabling win7 swapfile dangerous?
« Reply #6 on: October 08, 2024, 02:15:30 pm »
i disabled hibernation, page file ....  never had any problems

you can manually force a page file size ... since it's x times the ram amount ...

never had any problems

but there is some software who need the page file, and they don't do well without it ...  i had some audio video editor long time ago

for browsing, i use firefox based ones, and use firemin to kill excessive memory consumption

for XP the main problem is the TRIM function,  you normally uses drives who dont have it
« Last Edit: October 08, 2024, 02:21:50 pm by coromonadalix »
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4268
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is disabling win7 swapfile dangerous?
« Reply #7 on: October 08, 2024, 02:21:55 pm »
Quote
What is this pc used for, fairly static and light stuff or full applications and browsers?

It is used for this :)
https://www.eevblog.com/forum/programming/windows-inter-app-messaging-and-32-bit-apps-under-win7-64/

So, no Chrome (which grabs ave. 100MB of RAM for every open tab - not kidding - can post a screenshot). It is mostly an unattended machine, fanless, mostly accessed via remote desktop (RDP) which obviously runs over a VPN to its local LAN. There is Firefox as a browser (Chrome no good for win7 now).

I have now re-enabled the swapfile (auto size, c: ) based on views here. I have a huge amount of SSD space - 700GB on C: and 300GB on D: (D: unused).

Quote
with a ram-disk, using that for swap-file would cause "unexpected behavior".

I've heard that bizarre suggestion before :) AIUI it is just taking the piss out of dumb Windows architecture. In this case I don't have a huge amount of RAM however.

Quote
there is some software who need the swap file, and they don't do well without it

I can't prove this right now but I get the feeling that some win7-64 features may not work well without a swapfile; notably RDP (remote desktop).

Quote
If you don't have it on, all memory will be allocated and there is a hard limit. Things will crash if you hit this limit, because nobody checks if malloc returns null.

Nice :) That is what concerns me. Not worth the risk. The SSD is a non-cheap one anyway
https://www.amazon.co.uk/dp/B07KQZ1Z53
« Last Edit: October 08, 2024, 02:32:23 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline Postal2

  • Frequent Contributor
  • **
  • Posts: 731
  • Country: ru
Re: Is disabling win7 swapfile dangerous?
« Reply #8 on: October 08, 2024, 03:06:13 pm »
... the swapfile (auto size, c: ) ...
Set swap size to 64GB.
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4268
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is disabling win7 swapfile dangerous?
« Reply #9 on: October 08, 2024, 03:22:10 pm »
Both min and max set to 64000 MB, but why?
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline Postal2

  • Frequent Contributor
  • **
  • Posts: 731
  • Country: ru
Re: Is disabling win7 swapfile dangerous?
« Reply #10 on: October 08, 2024, 03:28:23 pm »
Set only min, do not touch max. Most likely, everything will fit in such swap, and Windows will not rewrite it at all.
Or set max to 128.
« Last Edit: October 08, 2024, 03:33:56 pm by Postal2 »
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4268
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is disabling win7 swapfile dangerous?
« Reply #11 on: October 08, 2024, 03:40:25 pm »
You cannot set a blank MAX, so I set 64000 and 100000.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline Postal2

  • Frequent Contributor
  • **
  • Posts: 731
  • Country: ru
Re: Is disabling win7 swapfile dangerous?
« Reply #12 on: October 08, 2024, 03:41:27 pm »
 
The following users thanked this post: peter-h

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28271
  • Country: nl
    • NCT Developments
Re: Is disabling win7 swapfile dangerous?
« Reply #13 on: October 11, 2024, 06:51:06 pm »
It seems to be a complex topic because the swapfile is also used for other stuff e.g. inter process comms!
That sounds dubious to me. Anyway, I have been running Windows 7 with swap disabled from day one and never experienced any problems. Only upsides and that is that Windows doesn't try to not-use the memory I paid money for AND being quicker.

Setting a swapfile to 64GB is bonkers. Even at 1% of that amount your computer will slow down to a crawl when it needs that much swap space.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15607
  • Country: fr
Re: Is disabling win7 swapfile dangerous?
« Reply #14 on: October 11, 2024, 08:36:41 pm »
I also have done this numerous times with WIndows with no issue whatsoever. No, that's not "dangerous". But as porobably many of us have done, that was mainly on machines for desktop use, that would not (and wouldn't need to) run 24/7 without ever rebooting. So, if that's the use case, I understand why there would be more of a concern, if some app that is used leaks memory, for instance. I would try to fix that rather than add more memory or swap, but I guess sometimes you don't have a choice.

I see zero reason that would impact IPC, other than if the OS runs out of memory and then anything goes.

But to start with, there is obviously not just one way of doing IPC, be it on Windows or other OSs, so mentioning "IPC" while not mentioning the exact method used is unfortunately of little help. (And I think the person in the best position to help would be the developer who wrote the app for peter.)
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28271
  • Country: nl
    • NCT Developments
Re: Is disabling win7 swapfile dangerous?
« Reply #15 on: October 11, 2024, 08:43:15 pm »
I run Windows 7 in a VM almost 24/7 for nearly a decade with swap disabled. BTW If IPC wouldn't work with swap disabled, then it wouldn't be possible to disable swap in the first place.
« Last Edit: October 11, 2024, 08:52:04 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 7376
  • Country: ca
  • Non-expert
Re: Is disabling win7 swapfile dangerous?
« Reply #16 on: October 11, 2024, 09:40:48 pm »
As explained in the link in the previous thread, XP is not SSD aware so it might make sense to disable it there, Win 7/10/11 are SSD aware so it probably makes less sense to try to "outsmart" the OS. If the small difference in performance matters, maybe best to investigate yourself for your own use case. Otherwise I would just leave it be.

https://www.reddit.com/r/windows/comments/5wsjh7/with_more_than_32gb_of_ram_is_it_safe_to_disable/
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17324
  • Country: us
  • DavidH
Re: Is disabling win7 swapfile dangerous?
« Reply #17 on: October 12, 2024, 10:25:44 am »
My recollection is that XP and other Windows versions still make a swap/page file on the Windows volume for critical functions when it is disabled.  On systems with plenty of RAM, I never had a problem disabling it.
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4268
  • Country: gb
  • Doing electronics since the 1960s...
Re: Is disabling win7 swapfile dangerous?
« Reply #18 on: October 14, 2024, 07:31:56 am »
It is a weird architecture to require a "file" for anything. It is bound to be 1000x slower than any other method.

Also a swapfile is bound to wear out an SSD faster than no swapfile - obviously.

Quote
XP is not SSD aware

XP does not issue the TRIM command (although you can issue it separately with various utilities) but that should not enable XP to trash the SSD. But we did that in the other thread, and IMHO without any conclusion. The wear should be evened out inside the SSD, transparently to the OS. AIUI, TRIM merely improves performance, by erasing unused blocks, so that a subsequent write does not need a pre-erase, and this tends to speed up writing several times.

That will in turn improve swapfile performance but it's a weird way to argue that :)
« Last Edit: October 14, 2024, 07:58:20 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15607
  • Country: fr
Re: Is disabling win7 swapfile dangerous?
« Reply #19 on: October 14, 2024, 08:31:47 am »
In any case, with a decent SSD that shouldn't be a big problem. You may be careful if that's a machine that must be set up and left unattended for years, but if maintaining it every once in a while is ok, given the typical SSD size you'd need for Win XP and a few apps, that's going to be like a $30 expense every couple years, at worst. And at best, it may well outlive the machine's life.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf