Is disabling win7 swapfile dangerous? - Page 1
Forum section: electronics / general

author: peter-h
author_rank: Super Contributor
timestamp: October 08, 2024, 06:36:36 am
content: 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 herehttps://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...

author: RoGeorge
author_rank: Super Contributor
timestamp: October 08, 2024, 07:40:23 am
content: 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.

author: peter-h
author_rank: Super Contributor
timestamp: October 08, 2024, 09:21:47 am
content: It seems to be a complex topic because the swapfile is also used for other stuff e.g. inter process comms!

author: Postal2
author_rank: Frequent Contributor
timestamp: October 08, 2024, 10:19:50 am
content: Quote from: peter-h on October 08, 2024, 06:36:36 amYou 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.

author: Jeroen3
author_rank: Super Contributor
timestamp: October 08, 2024, 01:45:09 pm
content: 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.

author: The Soulman
author_rank: Super Contributor
timestamp: October 08, 2024, 01:57:40 pm
content: 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) butinstead 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.

author: coromonadalix
author_rank: Super Contributor
timestamp: October 08, 2024, 02:15:30 pm
content: i disabled hibernation, page file .... never had any problemsyou can manually force a page file size ... since it's x times the ram amount ...never had any problemsbut 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 agofor browsing, i use firefox based ones, and use firemin to kill excessive memory consumptionfor XP the main problem is the TRIM function, you normally uses drives who dont have it

author: peter-h
author_rank: Super Contributor
timestamp: October 08, 2024, 02:21:55 pm
content: QuoteIt is used for thishttps://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).QuoteI've heard that bizarre suggestion beforeAIUI it is just taking the piss out of dumb Windows architecture. In this case I don't have a huge amount of RAM however.QuoteI 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).QuoteNiceThat is what concerns me. Not worth the risk. The SSD is a non-cheap one anywayhttps://www.amazon.co.uk/dp/B07KQZ1Z53

author: Postal2
author_rank: Frequent Contributor
timestamp: October 08, 2024, 03:06:13 pm
content: Quote from: peter-h on October 08, 2024, 02:21:55 pmSet swap size to 64GB.

author: peter-h
author_rank: Super Contributor
timestamp: October 08, 2024, 03:22:10 pm
content: Both min and max set to 64000 MB, but why?

author: Postal2
author_rank: Frequent Contributor
timestamp: October 08, 2024, 03:28:23 pm
content: 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.

author: peter-h
author_rank: Super Contributor
timestamp: October 08, 2024, 03:40:25 pm
content: You cannot set a blank MAX, so I set 64000 and 100000.

author: Postal2
author_rank: Frequent Contributor
timestamp: October 08, 2024, 03:41:27 pm
content: Quote from: peter-h on October 08, 2024, 03:40:25 pmOK.

author: nctnico
author_rank: Super Contributor
timestamp: October 11, 2024, 06:51:06 pm
content: Quote from: peter-h on October 08, 2024, 09:21:47 amThat 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.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 11, 2024, 08:36:41 pm
content: 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.)

author: nctnico
author_rank: Super Contributor
timestamp: October 11, 2024, 08:43:15 pm
content: 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.

author: thm_w
author_rank: Super Contributor
timestamp: October 11, 2024, 09:40:48 pm
content: 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/

author: David Hess
author_rank: Super Contributor
timestamp: October 12, 2024, 10:25:44 am
content: 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.

author: peter-h
author_rank: Super Contributor
timestamp: October 14, 2024, 07:31:56 am
content: 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.QuoteXP 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

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 14, 2024, 08:31:47 am
content: 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.