Windows vs Linux RAM Usage - Is Linux Better Than Windows?

  Рет қаралды 54,077

Gary Explains

Gary Explains

Күн бұрын

Windows and Linux are both modern multitasking operating systems which use virtual memory to run multiple tasks or processes. However are they the same? Is one a lean mean fighting machine and the other a memory hog? Let's find out.
Let Me Explain T-shirt: teespring.com/gary-explains-l...
Twitter: / garyexplains
Instagram: / garyexplains
#garyexplains

Пікірлер: 762
@satysin630
@satysin630 2 жыл бұрын
Yeah a video on virtual memory and how the OS and processes are handled with the MMU and such. Would be pretty interesting as has been a long time since I learnt about it and I don't really remember the ins and outs.
@mr.zalmannony6796
@mr.zalmannony6796 2 жыл бұрын
hell yeah we need that
@directorfaden
@directorfaden 2 жыл бұрын
And some sneak peak on TLB please!
@megan_alnico
@megan_alnico 2 жыл бұрын
I agree it would be interesting. One difference that I remember, and things could have changed, is that Windows pre-swaps everything. That means it allocates memory on the hard drive for a process when it starts and so it's available whenever. Linux on the other hand only allocates swap memory when it's needed. I think there are other settled nuances in the implementation differences.
@maxhughes5687
@maxhughes5687 2 жыл бұрын
YES. Let's play around with slow as Christmas some more.
@petevenuti7355
@petevenuti7355 10 ай бұрын
Is there any OS, or any tricks to get the system to use the hard drive as primary physical memory and just use the ram as a level ii cache? The os kernel can exist in ram, but all program memory should be on mass storage and treated as real slow physical memory.. not swapping or paging, just running off the mass storage from the get-go.. There are programs dozens of times larger than the maximum amount of ram my system can have and making a page file 20-50x larger than physical memory just don't work like that.
@FarrellMcGovern
@FarrellMcGovern 2 жыл бұрын
Linux has long had better memory management compared to not just Windows, but a number of other OSs. I know Linus and the Kernel crew were somewhat obsessive about memory management and making sure things used memory efficiently. At one point, I was working for a company in Montreal, and they had been running a Web based JAVA application on (at the time) Sun's Solaris, and were constantly have problems with stability, which we traced to memory. Back then, Sun Workstation memory was very expensive, so I said, let's try putting Linux on the same workstation, and see how the app runs since I knew that Linux was better with memory management. I prepared a Sun workstation that we had laying around as a spare with Linux, and all the appropriate software...and sure enough, it was totally stable, and our QA people tested it and they found it stable, and faster as well through their entire test suite. What I didn't tell them is that the workstation I had used had only half the memory the big server the software was going to run on! BTW, that's a nice view of the Parliamentry LIbarary in Ottawa in the background!
@zoomosis
@zoomosis 2 жыл бұрын
I was amused when toying with Illumos recently (a fork of OpenSolaris) in a VM with 4 GB RAM, just running "sudo pkg update" on a fresh install caused the package manager to run out of memory. Though it turns out it was partly my fault - Solaris wanted to use part of the hard disk as swap, but my VM was already running out of disk space. Still, you'd think 4 GB of memory would be enough memory to run the package manager. I note that it's written in Python, which I'm normally a big fan of, but obviously the pkg code needs a bit more work. Though admittedly this is all kind of an edge case, since if you really need to run the GUI version of Solaris in a production environment you'd want to run it on bare metal.
@jothain
@jothain 2 жыл бұрын
I somewhat disagree. Imo Windows handles drive caching way better if one has much memory.
@davidstephen7070
@davidstephen7070 2 жыл бұрын
what a joke better memory management? this topic keep exists. Ram comsumption always equal to feature that os give. what a joke compare ram usage after reboot. Windows include good looking animation, anti-virus (bitdefender). if u look in ram usage of application. it totally no different. it just different in reboot. Ram already cheap. so spend 2GB ram for OS. its not a big problem at now for so much feature that OS can give.
@davidstephen7070
@davidstephen7070 2 жыл бұрын
Linux only good for specific job. like run web server, vpn server only and so on. for big multi tasking. no reason can beat windows.
@cojoncioisolino8745
@cojoncioisolino8745 2 жыл бұрын
@@davidstephen7070 ok
@ernestuz
@ernestuz 2 жыл бұрын
I have prepared Linux systems that run in 32MB of RAM (yes MB, not GB), with GUI and no swap. It wasn't meant for general usage (prepared using Yocto for medical devices), but gives an idea of what you can achieve. I felt like an artisan sculpting a gem. [EDIT] Clarification to address some random replies: The device was a medical device able to operate without interruptions for years if necessary, the last test I know it was operating for 6 months w/o interruption, but years was the target, and had to support OTA and operate with no swap. The UI was touch driven and responsive, IEC 62366-2 certified. I'm sure that there are other options in the market, but I doubt many tick so many boxes. And yes, a version of Windows for Devices, Windows Embedded or WIndows IOT (or whatever name it has today) was part of the platform set evaluated by the customer.
@atemoc
@atemoc 2 жыл бұрын
My main computer runs a fully functional Linux desktop full of all the apps I use, and it only uses around 160Mb of RAM at boot
@casperes0912
@casperes0912 2 жыл бұрын
You sure you really mean Mb and not MB? That's just 4MB
@DePhoegonIsle
@DePhoegonIsle 2 жыл бұрын
Ya.... and to point out, you built it for a singular model of hw, for a very very very selective set of things. Linux is awesome for that, but don't get it twisted..... that isn't compatible with you normal desktip user.
@Johnscompany
@Johnscompany 2 жыл бұрын
@@atemoc 160 mb? Awesome. What distro do you use?
@loremipsum3147
@loremipsum3147 2 жыл бұрын
@@casperes0912 they probably meant MiB
@CommodoreFan64
@CommodoreFan64 2 жыл бұрын
This is yet another reason to love Linux, as it can make older hardware even those limited to to 4GB RAM usable, were as WIndows on the same hardware is a no go.
@alastorgdl
@alastorgdl 2 жыл бұрын
OLDER hw limited to 4 GIGABYTES?!?! Said by a Commodore64 fan?!? Something is not right here
@distant6606
@distant6606 2 жыл бұрын
@@georgebetrian676 bruh
@distant6606
@distant6606 2 жыл бұрын
don't even need 4gbs or ram. if you download a minimum installation of arch linux for example and download a minimalistic window-manager or desktop-environment you can easily get away with 2gbs of ram.
@UltimusShadow.
@UltimusShadow. 2 жыл бұрын
I have an old Dell XPS 430 from 2009 lying around, on Windows 10 it seemed like it was dying. I install GNU/Linux in June & it's revived, now it runs Debian.
@CommodoreFan64
@CommodoreFan64 2 жыл бұрын
@@UltimusShadow. Debian is not bad, it just does not update fast enough for me, which is why I run Solus Linux which so far has been the most stable rolling release I've ran, and the only major issues I've had so far that were not my own fault, is I can't get the system fan in my 13in Mid-2012 Macbook pro to spin as fast as it should as MBPFan is not in the repos so it runs a little warm to the touch, but does not thermal throttle.
@iodreamify
@iodreamify 2 жыл бұрын
And that's with PopOs Gnome, which is kind of known as a ram hog in itself. I bet with KDE or Xfce the results would be even lower. But of course if we're only talking about raw ram usage numbers.
@runed0s86
@runed0s86 2 жыл бұрын
I don't understand why people still use popos. It's in the same league as hannah montanna os. It's a meme. Just use MX or Mint!
@amitmatok2883
@amitmatok2883 2 жыл бұрын
@@runed0s86 both mx and mint looks like its from 2004..pop is modern and works perfectly on my nvidia rtx3070
@yak28
@yak28 2 жыл бұрын
@@runed0s86 Because Pop!_OS what almost no other Linux based OS is. It's made by a company that installs it on their own computers to sell! That brings a quality of focus on the desktop Linux rarely seen among pet hobby distros. And it's improving rapidly every year.
@jimbo-dev
@jimbo-dev 2 жыл бұрын
If you have the ram for gnome, why not? Vanilla gnome is the best thing I’ve experienced in desktop environments. I prefer it over macos and kde. It definitely takes some time getting used to, but it is very much worth it. And yes, I am a (vanilla) gnome fanboy
@benedani9580
@benedani9580 2 жыл бұрын
A fresh KDE Plasma on x86_64 is at around *400-500 MB.* Not a desktop designed specifically to be lightweight, either.
@yaBoyDreamer
@yaBoyDreamer 2 жыл бұрын
would love that memory (virtual) allocation video! :D
@SomeRandomPiggo
@SomeRandomPiggo 2 жыл бұрын
i don't know much about virtual memory so i second that
@Godfather-qr6ej
@Godfather-qr6ej 2 жыл бұрын
its about 3 or 4 commands on linux, really easy, look up Arch Wiki.
@GaryExplains
@GaryExplains 2 жыл бұрын
It isn't about commands, it is about how virtual memory works at the kernel level.
@Godfather-qr6ej
@Godfather-qr6ej 2 жыл бұрын
@@GaryExplains yeah ive been wondering how that worked for a long time, would be nice to make a video on that.
@SomeRandomPiggo
@SomeRandomPiggo 2 жыл бұрын
@@Godfather-qr6ej for what? isn't it enabled by default in the kernel?
@fever0
@fever0 2 жыл бұрын
This was a very informative video. Thanks Gary.
@Shaddad_Gomid
@Shaddad_Gomid 2 жыл бұрын
Thanks Gary, very informative!!
@findinggreatness
@findinggreatness 4 ай бұрын
Im glad i found your channel very thorough and persice
@gokuljosh1186
@gokuljosh1186 2 жыл бұрын
Does zram / dump on linux have significant impact, and how does that compare to pagesys on windows. Can you please do a video on that?
@ok-tr1nw
@ok-tr1nw 2 жыл бұрын
Im currently using zram on a laptop with 2444mhz ram It doesnt really impact performance maybe 1-2% list but adds alot of virtual ram without killing my ssd 16 -> 24 with 1-2 ratio compression
@ok-tr1nw
@ok-tr1nw 2 жыл бұрын
2-1*
@ed.puckett
@ed.puckett 2 жыл бұрын
Thank you, this was very illuminating!
@gorjaharchangel2267
@gorjaharchangel2267 2 жыл бұрын
Very nice and informative video! I have a secondary PC with a quad core s775 Xeon and 8Gb of Ram. I only use it 4-5 times a month for internet browsing,watching video and in the odd case for some emergency Zoom call from work. It's been a couple of months that I am considering installing Linux (instead of Win10) on that machine to give it some more breathing room. My main concer is driver support and general compatibility of the hardware as it is quite old. After watching your video I am a step closer to making that decision.
@sudipchatterjee
@sudipchatterjee 2 жыл бұрын
Yes, I want that video on virtual memory. Thanks for this one!
@muddyexport5639
@muddyexport5639 2 жыл бұрын
Thumbs up on this vid and anothe r thumbs up on a videonon the MMU and virtual memory management, etc. Also, having worked on the IBM AS/400 or iSeries or Series i, I was always impressed with their hardware addressing via verticle and horizontal microcode with the OS never addressing or seeing the physical. A very unique computer architecture.
@mckengineer5727
@mckengineer5727 2 жыл бұрын
Yes videos on memory are interesting, I remember being a developer in the early 90’s, and being particularly concerned about the impact of ‘page thrashing’ on the logistics system we were developing, but not truly understanding the concept and so feeling limited in my design decisions… long time ago, fun times 😁
@markusbuchholz3518
@markusbuchholz3518 2 жыл бұрын
From my humble point of view Gary's YT is the one of the most exciting and consistent tech channel available. Thanks for all the videos provided so far. This one is outstanding since I am happy user of great Linux since 2k. Thank you! Have a nice day!
@maxhughes5687
@maxhughes5687 2 жыл бұрын
The greatest improvement to PC performance I have ever experienced wasn't new HW. Deepin 15 BETA loaded to a ram disk that kept up with a Ryzen build with a GEN3 NVMe drive. IDK how but MX LINUX 21 can be loaded to boot to ram.
@albertstarfield
@albertstarfield 2 жыл бұрын
interestingly Windows is really optimized on swapping to compensate that memory usage and prevents lockup or stall while Linux memory usage is low but when on high pressure memory usage and started to swap it tends to locks up (if you dont have the prelockd, nohang, le9 patch, etc..)
@syarifairlangga4608
@syarifairlangga4608 2 жыл бұрын
Well in windows, the memory management is in kernel level. While in Linux its in the software itself. For security its saver, but performance...
@christianlockley2578
@christianlockley2578 2 жыл бұрын
@@syarifairlangga4608 dude you know nothing about what you speek of
@DarkGT
@DarkGT 2 жыл бұрын
@@christianlockley2578 Rather than saying "Dude you know nothing", say "I disagree, this is why you are wrong..." and you go ahead and explain the right way of the architectural operations to prove him wrong.
@kquote03
@kquote03 2 жыл бұрын
Honestly more distros need to start shipping a functional OOM killer...
@kquote03
@kquote03 2 жыл бұрын
@@DarkGT The problem is that what they said is just wrong. I agree that maybe saying "you don't know nothing" is harsh and quite frankly rude, but that still doesn't change the fact that the info is wrong, it's like if someone told you water boils at 50C, it just doesn't --there is nothing to explain.
@HumbleBountyHunter
@HumbleBountyHunter 2 жыл бұрын
I've seen others say Windows uses 4GB of RAM after boot but I've never seen it myself. I'm currently using 3.4GB out of 16GB, with two Firefox/KZbin tabs open and 20hrs. uptime. It is worth noting I've seen both Windows and Linux use more RAM when more is available. With 4GB total Windows 10 will use 1.6GB after boot, compared to 2.4GB with 16GB total.
@lycanthoss
@lycanthoss 2 жыл бұрын
Yeah, it's weird. When I had just installed Windows 11 on my new PC it was using only 2-3 gigs of memory, but after installing all the apps and all the updates it started sitting at 5-6 gigs. Windows must be caching a crap ton of stuff. Honestly it doesn't matter much, unused RAM is useless RAM. And if that memory usage is for caching then I'm sure Windows can clear it when it actually needs to be used.
@tenfourproductionsllc
@tenfourproductionsllc 2 жыл бұрын
It will only use more than 4 GB of RAM on startup if it can. I am typing this right now, yes right now, on an HP Stream 7 with 1GB of Ram running Windows 10. Using more RAM On startup if available is a very good thing, it means the system is optimizing and prefetching programs you use so they run faster than better.
@douglasv4266
@douglasv4266 2 жыл бұрын
The way Windows reports used ram is interesting to say the least, as depending on if I enable or disable the onboard GPU on my CPU and which PCIe GPU (AMD or Nvidia both with 8GBS of Video ram) I fit I can get the same computer and Windows 10 build to report between 2GB's and 11GBs of used ram without running any application. This seems to be a result of how shared memory buffers for the GPUs both built in and PCIe are reported. As such the reported used or free ram may or may not reflect how much actual systems ram is being used and how efficient windows ram management is, and ,may be more down to how the GPU drivers are setup for the system you are looking at ;-)
@looneyburgmusic
@looneyburgmusic 2 жыл бұрын
High Windows RAM usage at bootup is most likely from Windows SuperFetch - the OS is filling up available RAM with whatever programs you would have last used, so they will open quicker.
@test40323
@test40323 2 жыл бұрын
A fun exercise. It should be said using more memory is not necessarily a bad thing. Memory if used to enhance speed it's a good thing, if a program is carrying unused baggage and making memory unavailable to others it's a bad thing.
@chrisbowser
@chrisbowser 2 жыл бұрын
Great video Gary and pleased to see you used my distro of choice Pop. This is certainly a much fairer comparison than say using Puppy Linux. I would be interested in your thoughts on why say Firefox in Windows uses more RAM than Linux. To me this was the most confusing part, unless Firefox can offload more of it's work onto existing Linux processes and hence doesn't need to spawn new ones? Thanks for getting my brain thinking on a Tuesday...
@curiouskitkat
@curiouskitkat 2 жыл бұрын
I’m curious about how this compares to MacOS
@drgr33nUK
@drgr33nUK 2 жыл бұрын
I have 16gb of memory on my laptop running Arch Linux. It still amazes me that I can use nearly all of it just by opening up PyCharm and Firefox.
@asukaainun7473
@asukaainun7473 2 жыл бұрын
interesting video as always Gary. can you please explain Android Entropy Threshold next time? i googled it yesterday but never have any conclusive explanation. so would you be kind enough to explain it next time?
@kychemclass5850
@kychemclass5850 2 жыл бұрын
Nice. Tq Gary.
@thomasmabika7291
@thomasmabika7291 2 жыл бұрын
Can we do Linux vs FreeBSD? Is there even a difference in memory usage?
@asporner
@asporner 2 жыл бұрын
Great video. Would be nice to do a deeper dive on paging performance. When you have enough memory it's probably more or less moot (maybe here is a lead-in to filesystem performance). Years and years ago (early 2000's) I read a paper on FreeBSD on how they do "Page coloring" to help prioritize which pages get swapped when there is not enough ram. I wonder how does the various OS's implement smarts on this. Also swap file vs partition. Filesystem performance plays a part when it's a file vs a raw partition where there is no filesystem.
@shalomrutere2649
@shalomrutere2649 2 жыл бұрын
I am now waiting for a detailed video covering MacOS 12 and Windows 11. Their differences in handling multitasking and multiple displays and the advantages and disadvantages of each.
@John.0z
@John.0z 2 жыл бұрын
It is useful to see some numbers put to the usual claims. Great work Gary.
@plutack
@plutack 2 жыл бұрын
Can't stop enjoying your content tbh
@dappermuis5002
@dappermuis5002 2 жыл бұрын
I noticed the difference with a 2016 laptop a little over 2 years ago. I couldn't even get windows 8.1 to load up Blender. It worked perfectly fine when using Linux mint. True I wasn't gong to be doing heavy tasks with it. As it was a entry level laptop. But been able to load it in the first place said it all.
@Pwneglyph
@Pwneglyph 2 жыл бұрын
I've been test driving ubuntu mate on a 2 GB Ram netbook, with a classical HD and an intel pentium for work this week; it works like a charm (general office stuff, browsing, video...) I have more powerful machines but it feels so damn great! Now I have an amazing battle computer.
@xKynOx
@xKynOx 2 жыл бұрын
KZbin recomends me so many random videos so why has it never shown your channel i will (now) sub to.
@richardroy6747
@richardroy6747 2 жыл бұрын
Great video,thank you....
@RegisMichelLeclerc
@RegisMichelLeclerc 2 жыл бұрын
Actually, yeah, it'd be cool to make a video on how memory is actually organised and how the structural difference impacts the performance, especially before the systems starts swapping (which is obviously going to happen sooner with the Windows system, even cheating on the swappiness on the Linux system to force it swap earlier). Basically, if you had an infinite amount of RAM on either system, is one system more performant than the other?
@davidadams7355
@davidadams7355 2 жыл бұрын
Great Video. Can you also do a memory comparison for a server setup ? file server / web server / ... Where one does not need a GUI.
@BWGPEI
@BWGPEI 2 жыл бұрын
Thank You!
@felixlf-lorentz3937
@felixlf-lorentz3937 2 жыл бұрын
I completely agree on this video and I can even mention that even the CPU usage seems to be much lower in Linux than Windows 10. I notice on the battery life and fan usage. When I run windows I hear frequently the fan running and battery life last less than when I use Linux. I even tested this in a completely new install in Windows and same result.
@jirehla-ab1671
@jirehla-ab1671 2 жыл бұрын
I think system calls in windows are more complex than in Linux
@loliveira
@loliveira 2 жыл бұрын
How much time did the tests take? It is ok to Windows use more memory if the time to compile was faster the Linux.
@bonniemunene5163
@bonniemunene5163 2 жыл бұрын
What do except from an Os that watches you as you use it. As you run apps drm and other spyware software is running in the background
@user-pv7yx5ls4m
@user-pv7yx5ls4m 5 ай бұрын
That is awesome video
@Gavinconaghty
@Gavinconaghty 2 жыл бұрын
Thanks Gary. Nice vid, the only thing one might be asking is WHY does windows use more than linux for the same program? Are there decisions made like "lets load the whole lot into ram so things load quicker when the user wants them..."
@nando_br
@nando_br 2 жыл бұрын
You could make another video showing the processor load in each system.
@nigo1787
@nigo1787 2 жыл бұрын
Interesting video as lack of RAM is often the killer of an old PC. I got a old thing with Windows 10 and Mint Xfce and it was interesting for me to compare. Actually it was not that different, every time I start two or three modern apps (KZbin on Opera amongst other things) I run out of RAM and swap begins. Windows need some fine tuning (disabling Windows Defender, Update and stuff) before it runs OK but after that, it's not that bad and respond actually quite well. On heavy usage, once Linux swapping blocked me completely and Windows did not, but I don't (yet) make generalities out of it RAM usage it interesting, but swap management and the way applications repond to it is even more interesting, in my mind
@woodcat7180
@woodcat7180 2 жыл бұрын
It would be interesting to see some speed benches. How does memory used effects speed.
@Qushaak
@Qushaak 2 жыл бұрын
Agree!
@maxhughes5687
@maxhughes5687 2 жыл бұрын
8 channel ram is four times faster than dual channel ram. Quad channel ram is twice as fast as dual channel ram. Dual channel ram is faster than even a new NVMe storage drive and has way less latency. You guys are on a race to the bottom.
@woodcat7180
@woodcat7180 2 жыл бұрын
@@maxhughes5687 That's not what I meant. If an app is using more memory in one OS, is it as fast as the one running on OS using less memory?
@maxhughes5687
@maxhughes5687 2 жыл бұрын
@@woodcat7180 YES I would say the one using more memory is as fast as the one using more memory.
@woodcat7180
@woodcat7180 2 жыл бұрын
@@maxhughes5687 😁, edit: LESS!
@bbbl67
@bbbl67 2 жыл бұрын
So Gary, when did you come and visit Ottawa Canada? You were quite clearly doing your video from the National Art Gallery, with the Parliament buildings in the background. 😉
@GaryExplains
@GaryExplains 2 жыл бұрын
😂
@salahaa1
@salahaa1 2 жыл бұрын
And what about the performance is it the same on both systems or is one is faster than the other
@Aygross
@Aygross 2 жыл бұрын
Curious about pagefile vs swap usage in windows and Linux
@shamrockisland
@shamrockisland 2 жыл бұрын
Interested in virtual memory video. Thanks.
@GaryExplains
@GaryExplains 2 жыл бұрын
There was quite a lot of interest, so I published it quite quickly. Here it is: kzbin.info/www/bejne/apaUaayvl7WiZ6c
@stealthyziko
@stealthyziko 2 жыл бұрын
Thanks Gary that was interesting. I think a very interesting comparison also would’ve been comparing them to MacOS because MacOS is Unix based but a very modified version that I expect to be much heavier than any Linux distribution out there. It also has an X86_64 version for intel processors and an arm version for the new M processors from apple. That video would be especially interesting because with the M processors the memory is on chip and shared between the CPU and GPU cores, and not upgradable. Also very expensive to get a higher processor configuration to benefit from the larger memory (especially if you want 32 GB like me).
@christopherfortney2544
@christopherfortney2544 2 жыл бұрын
MacOS is unix not unix based it is certified unix dumby.
@2001pulsar
@2001pulsar 2 жыл бұрын
I'd like to see a dynamic, real-time visual representation of the memory pages, colour coded by PID to see the randomness of the distribution. Is this even a thing?
@locatemarbles
@locatemarbles 2 жыл бұрын
In the spirit of unused RAM is wasted RAM, Windows will incorporate ads in the file explorer. Brought to you by Carls Jr.
@RebelliousCanadian
@RebelliousCanadian 2 жыл бұрын
I just wonder how the memory is actually being utilized. For example, I open a movie file in Windows that's 4GB, and the same in Linux, Windows may opt because of 16GB available to store it all in memory, where Linux might be conservative and stream from the disk more often. I would like to see the relation between the memory and how often is the disk being accessed, both HD and SSD. What are also the benchmarks about the speed of startup of large programs between the two. For example Loading a 1GB image file, closing the app and re-opening the file. Is one stored in memory for faster access between the two?
@weretii5401
@weretii5401 2 жыл бұрын
I miss the information on how long did e.g. the monk render take on Windows vs Linux. Right now, it seems a bit pointless to just compare the RAM usage. Did they take approximately the same time, or did one of them finish faster?
@GaryExplains
@GaryExplains 2 жыл бұрын
It isn't "a bit pointless to just compare the RAM usage" when the video is called "Windows vs Linux RAM Usage". This video isn't about performance. It also isn't about cream cakes which is why I don't mention them either.
@eliasdetrois
@eliasdetrois 2 жыл бұрын
It would be interesting to see if there is any noticeable performance difference when running on the same hardware with different amounts of memory being used.
@grizzlyrideemwet1698
@grizzlyrideemwet1698 Жыл бұрын
Gary, This is a very challenging topic to do a complete comparison. The assumption that using more memory is bad is something I'm not completely sold on. Swapping pages to disk is bad in that it slows things down but if a system optimizes performance within it's the total system memory available, that seems preferable? What about a comparison of running tasks on Win vs Linux with insufficient memory and counting the page faults/page swaps? If you can show that Linux pages less given the same physical memory, then I would find the comparison more compelling. I'm a fan of linux myself, started in the 1980's with HP-UX, so I'm not being critical of either OS, just thinking about what other factors effect these systems memory management schemes.
@GaryExplains
@GaryExplains Жыл бұрын
Using more memory can't improve performance (outside of caching, which generally happens at an OS level, not per process level). Using more memory will cause more swapping, which as you correctly said is bad for performance.
@grizzlyrideemwet1698
@grizzlyrideemwet1698 Жыл бұрын
@@GaryExplains I've been fooled before by lazy de-allocation schemes. Optimum overall performance doesn't always prefer cleaning up immediately, there is no penalty for using more memory until you run out. Perhaps you accounted for that. I would not be surprised to find your results are indeed the full story but I am always looking for the technical loopholes.
@salaciouscreations4323
@salaciouscreations4323 2 жыл бұрын
To be fair since I popped a 64gb kit in I see windows 10 idle at 9gb. On the 16gb machines I see around 5gb. On a VM however 2gb and that's with 20gb available to the VM.
@BlobBlobkins
@BlobBlobkins 2 жыл бұрын
Windows 11: "Hold my beer" PC: "please no"
@MrDeadmanwalken1
@MrDeadmanwalken1 2 жыл бұрын
It also depends on which distro youre using for linux. I use a few distros that use 64mb min and a few that use less than 300mb
@GaryExplains
@GaryExplains 2 жыл бұрын
Well since I was trying to compare like-with-like, I didn't use a niche distro.
@Jagi125
@Jagi125 2 жыл бұрын
Untill recently, I was using thinkpad with 4GB RAM. It's ridiculous, that it come with windows preinstalled, since just the fresh install was enough to get swapping. Out of couriosity, I've tested how it runs, and we're talking like 10+ seconds to open the menu bar.
@shab-re5334
@shab-re5334 2 жыл бұрын
on my linux setup, I've got just a window manager called dwm and it just uses 52 mb of memory at start
@rancidbeef582
@rancidbeef582 Жыл бұрын
Years ago I found an interesting bug in Windows NT 4.0 Server. I was porting a rather large Unix application to NT. The computer I had was a real beast. I don't remember how many megabytes of RAM it had, but it was a lot for the day (maybe 512 MB? For comparison I think my home PC had about 16 MB of RAM at the time.). But the hard drive was a little more limited, so I didn't allocate much space for the page file (swap space in Unix lingo), maybe just 2 MB. But apparently when I started up the programs that made up the application, Windows would start trying to swap out existing stuff to the pagefile to make room for more stuff in RAM even though it didn't need to since it had loads of RAM. As soon as the small page file was full, performance would hit a wall and it would start showing errors about being out of memory even though there was no way it had used up 512 MB (or whatever it was). But if I wasted a full 512 MB of disk space for a pagefile that would never get used much, everything ran just fine.
@yuehuang3419
@yuehuang3419 2 жыл бұрын
Calculating memory usage is tricky. Most status reporting only count the user memory, but often doesn't count the kernel memory like page table increase and system resources. On the user side, shared memory be complicate because multiple application could share the same resources. I like using "zero"-ed memory as it reflects the memory used and if RAM was reduced below this line would result in perf loss.
@GaryExplains
@GaryExplains 2 жыл бұрын
I know it is tricky, I even say so in the video!
@FlorinArjocu
@FlorinArjocu 2 жыл бұрын
I kind of expected these results, but not by such a margin. Interesting. Proud to have switched to Ubuntu linux, even though I am still counted as a Windows user, as the laptop came with Windows.
@RajeshPachaikani
@RajeshPachaikani 2 жыл бұрын
Would like to see a video on virtual memory.
@perperikis5501
@perperikis5501 2 жыл бұрын
I think it greatly depends on each application, though. What happens when it comes to other types of s/w ? E.g. what is the behavior for VMware player ? Or a java application server, docker etc.
@perperikis5501
@perperikis5501 2 жыл бұрын
@Mohammed Mesum Hussain Yeah but too few apps to get to a solid conclusion. I'd like to see more demanding apps and how they scale to each OS.
@tofu_golem
@tofu_golem 2 жыл бұрын
Thanks. I kept getting the terms "pig" and "hog" mixed up. I know one refers to software that uses a lot of memory, while the other refers to software that uses a lot of storage, but I could never remember which is which, and I'm not sure younger programmers still use that slang.
@TheSulross
@TheSulross 2 жыл бұрын
well, besides caching, the services and how many services that are startted up will have an impact. A typical Windows install, in my opinion, will tend to have far more services than a typical Linux install. And the question becomes - how essential (really) are a lot of those Windows services?
@Ignacio.Romero
@Ignacio.Romero 2 жыл бұрын
The answer is not essential at all, just a lot of microsoft bloatware
@igorgiuseppe1862
@igorgiuseppe1862 2 жыл бұрын
if they were used by thirdy party applications, then they would be essential, but if that was the case, then opening new applications would have less aditional ram usage on windows than on linux, that simply isnt the case, quite the opposite, so those services arent that usefull. the main issue is that microsoft dont have any competition, no matter how much windows is bad, it wont lose marketshare, no matter how much microsoft invest into improving it , they wont gain aditional marketshare since they already dominate it.
@deViant14
@deViant14 2 жыл бұрын
I used to use Black Viper's list of unnecessary services to disable them but it's definitely not as bad as it used to be. I also have a 5800X with 32GB RAM so I don't spend a lot of time on this. Also, that's with Windows, Rockstor, and BunsenLabs running on Proxmox.
@Elrinth
@Elrinth 2 жыл бұрын
Which version of Windows were you running? I'm assuming 10. Because if you were running 3.11, 95, 98, ME, 2K, XP I'd be surprised if it was more than PopOS.
@GaryExplains
@GaryExplains 2 жыл бұрын
Windows 11, as I stated in the video.
@Elrinth
@Elrinth 2 жыл бұрын
@@GaryExplains Ahh I had forgotten it when I had watched thru the video and didn't see it anywhere when I commented. Very interesting video nevertheless, thanks for making it! Keep up the great work! My friend 20 years ago kept say linux is less demanding for doing the same tasks. I always believed him, but since I was a gamer, linux wasn't really an option for me. But these days linux might actually be viable. Tho music production with vsts etc might not be good enough. Like all vsts aren't available on linux or mac... or other way round sometimes.
@valtarijunkkala
@valtarijunkkala 2 жыл бұрын
not quite sure why I clicked on this since I knew the result from the get go, but I am glad I did. I learned the hard way that windows is a memory hog, that is by making a server out of an old prebuilt. Surprise to no one ran out of memory eventually and as a quick fix switched to linux. I did end up adding more ram to the machine but I like having the overhead that comes from linux as well, since I will definitely keep expanding the software that runs on the machine.
@MansakeLabsOfficial
@MansakeLabsOfficial 2 жыл бұрын
I've set up a Thinkpad T460 with Linux, and got it to run Monster Hunter World. I would not recommend playing Monster Hunter World on a Thinkpad T460, but if your really want to or have to, you can. Tip: Using the lowest resolution has the best performance. Take a mental note of where the resolution settings are, as you won't be able to read them when you go to change them again.
@tarigeltayeb413
@tarigeltayeb413 2 жыл бұрын
why there isn't speed test G this year?
@pixelfairy
@pixelfairy 2 жыл бұрын
Wonder how much of that difference is due to shared libraries like gtk, which windows would more likely have statically linked.
@seabrookmx
@seabrookmx 2 жыл бұрын
That won't impact memory usage. Even if you have programs sharing a dynamically linked library, that only saves disk space. Each program has its own memory space so if you have five programs that use a gtk window there will be five sets of memory allocations.
@GaryExplains
@GaryExplains 2 жыл бұрын
I don't think you are right Tyler. Shared read-only memory is a thing.
@guilherme5094
@guilherme5094 2 жыл бұрын
Yes, more videos please.
@riseabove3082
@riseabove3082 2 жыл бұрын
I use both Winodws 10/11 and Linux with Gnome mostly but also KDE and i3 and BSPWM. I even used Fedora 35 with it's new SystemD Ram improvements and in all Linux still freezes and chokes when it gets low on ram due to the swapping ram to file where as Windows no matter what I try I cannot get it to freeze or choke when running out of ram. For some reason, Windows handles ram much more efficiently when it comes to swapping.
@tomenglishmusic6808
@tomenglishmusic6808 2 жыл бұрын
This is great. Wouldn’t it be interesting to repeat for macOS on x86 and Apple Silicon?
@DarkGT
@DarkGT 2 жыл бұрын
I'm currently running my Ubuntu with Brave browser and 16 tabs opened. 3.2 Gig used, about 170 MB in swap.
@satysin630
@satysin630 2 жыл бұрын
An interesting breakdown. I had suspected Linux to use less memory but not by quite so much to be honest. While it is hard to get a breakdown of "performance" for things like LibreOffice and Firefox I do wonder what the perf difference there is between Windows and Linux for that Blender test? Did Windows finish the job faster or slower than Linux? If faster could it be some memory strategy on Windows that perhaps Linux lacks? Or if slower perhaps it is not efficiently using the memory it takes on Windows and could use optimisation to reduce its foot print? On the whole I am not really concerned with memory use on a desktop system, the way I see it is unused memory is a bit of a waste providing the OS can free it up in an instant. One thing I do like about macOS is its purgeable memory system so that applications can build up a cache specifically marked as purgeable so it may 'look' like the app is using a lot of memory but really it can be destroyed and used elsewhere if needed, just while it is available might as well keep it there than write it out to desk or rebuild it later.
@Mathias-bz2kr
@Mathias-bz2kr 2 жыл бұрын
phoronix probably has a comparison, where linux browsers are much faster than windows. In my personal experience firefox is much faster than on windows, same with brave browser, opens faster, pages load faster.
@steven1000000000
@steven1000000000 2 жыл бұрын
Interesting the difference between running the same programs on windows vs Linux - Given that a string is a string and an int is an int regardless of OS, I would have thought that they'd be much closer. I would have thought that the difference would have mostly beeen due to different window decorators, which would have been minimal. Is it the underlying graphics libraries which account for the large difference? Obviously, the OS is the part where I knew there was a vast difference - I've created a custom Linux OS based around ICEWM for a Raspberry PI which boots to desktop in around 100MB.
@xrafter
@xrafter 2 жыл бұрын
No, there is difference in some C/C++ Integer types between OSs. For example: the "long" int type is 64 bit in linux, and 32 bit in windows.
@presentarmsonlinux
@presentarmsonlinux 2 жыл бұрын
In fairness he did use POP which if I recall correctly uses Cosmic (I think) which is based off Gnome which is the heaviest of all Linux desktops and it still came on top compared to Windows, not only that tool kits are shared which is why Firefox looks exactly the same on the 2 platforms and so on. So even with the disadvantage of having a Gnome based desktop :D
@xrafter
@xrafter 2 жыл бұрын
@@presentarmsonlinux Problems with Gnome?
@ernestuz
@ernestuz 2 жыл бұрын
I think it might be due in part to how Linux share memory between processes and how applications are build against libraries, in Linux you tend to build against the system libraries (so the same library for all the applications), in Windows you tend to distribute the libraries you need (so several versions of the same library to serve several applications). Linux also only loads into memory the parts of an executable that are needed (in tech lingo, it maps the file into memory), and under memory pressure it does not send it to swap, just discards the data in RAM and if needed loads it again from disk. Probably Windows does something similar, but I don't know up to what extend. One thing that caught my attention is when I have used Blender, Linux seems a 20% faster, in a task that is basically GPU load... there should be more magic happening in the memory subsystem.
@ernestuz
@ernestuz 2 жыл бұрын
@@xrafter It depends of the 64-bit memory model used by the distribution.
@abdulmughniahmad7222
@abdulmughniahmad7222 2 жыл бұрын
Would love to see a video on Virtual Memory
@theredscourge
@theredscourge 2 жыл бұрын
Keep in mind that in Windows since XP, it only frees memory when it needs to, so if you open a ton of programs then close them, it won't clear everything, but if you open something else up that needs a lot of memory, it will clear out old memory as needed. Linux is starting to do more of this too, particularly in favor of filesystem cache, which will be cleared aggressively if something else needs that space.
@GaryExplains
@GaryExplains 2 жыл бұрын
No, it isn't quite as you describe.
@drigans2065
@drigans2065 2 жыл бұрын
It would be interesting to do a deep dive to understand why there is the difference overall (on bootup say) as well as individual program differences. Windows is a much larger OS (in terms of code base), there may be more processes running - many of which may not be doing very much that are useful most of the time, but philosophically Windows is designed to support many legacy edge cases - that comes with baggage. I know the video mentioned the issue of account for free memory from available memory, tricky to quantify. If you have much more code running, then those .dlls are memory mapped so are "using" memory virtual memory pages, however they are available to be used by any program that needs those pages. Also Windows desktop OS is very geared up for all the legacy frameworks to support the legacy applications, particularly for desktop/video. It's a bit difficult to compare the two when Linux doesn't have the same legacy heritage (baggage!)
@johntilghman
@johntilghman 2 жыл бұрын
A video for how virtual memory management is done would be MOST welcome.
@GaryExplains
@GaryExplains 2 жыл бұрын
It is here kzbin.info/www/bejne/apaUaayvl7WiZ6c 👍
@madmotorcyclist
@madmotorcyclist 2 жыл бұрын
I've notice that if the same app is created across all platforms that the app size always seem to be the smallest for MacOS with Linux close behind. Windows usually seems to always be the largest. As for app execution space I have no clue.
@rosyidharyadi7871
@rosyidharyadi7871 2 жыл бұрын
I don't know how MacOS works, but for linux I believe it has something to do with shared library. You install application X and it needs Z as dependency. Other time you install application Y that also needs Z, package manager will skip installing Z again because it's already there.
@bharathg8072
@bharathg8072 2 жыл бұрын
By using a window manager on the linux machine you can further reduce the ram used. My system, no joke, idles at around 250MB of ram used. And this is not using some cut down distro. This is using POP OS with i3WM
@GaryExplains
@GaryExplains 2 жыл бұрын
Obviously there are lightweight Linux distros, but that wasn't the point of the video.
@bharathg8072
@bharathg8072 2 жыл бұрын
@@GaryExplains I'm not saying this had to be included in the video, the video covers everything needed. Putting this info in probably would confuse a lot of people. Just pointing out that with Linux you get the freedom to choose!
@pranav666
@pranav666 2 жыл бұрын
Which app do you use to measure ram in Linux and which in windows
@Godfather-qr6ej
@Godfather-qr6ej 2 жыл бұрын
yeah, that is an important thing because there are different ways to measure ram. another important thing is how much ram the computer uses when other programs need it.
@pranav666
@pranav666 2 жыл бұрын
@@Godfather-qr6ej my polybar says one neofetch other top other and htop other... Polybar is the right one
@silverywingsagain
@silverywingsagain 2 жыл бұрын
After obsessively optimizing stuff i used to be able to get windows 10 down to about 1.2gb of ram on a fresh boot. Doesn't compare to the KDE Linux I run now, which starts up at about 300mb though.
@noahqh
@noahqh 2 жыл бұрын
I have to wonder if the arm64 architecture is sharing video memory with the main system memory. It just seems like too big of a difference to be solely based on the CPU architecture.
@GaryExplains
@GaryExplains 2 жыл бұрын
Where did you see a big difference between x86-64 and ARM64. I thought I showed that they were basically the same in terms of overall memory usage.
@deathhog
@deathhog 2 жыл бұрын
Yes Gary, please explain the mmu in a bit more detail.
@ananon5771
@ananon5771 2 жыл бұрын
one thing to mention is popOS is far from the lightest distro,you could take it ridiculously low with something like ubuntu MATE or especially those fancy window managers (though those systems are so minimal,it may get a bit unfair). this proves evermore that linux is definitive for older computers.
@benfubbs2432
@benfubbs2432 2 жыл бұрын
I'm not sure if this is just about less ram = better. Maybe superfetch uses more ram but makes the user experience better (for example)? I'm no expert and I am not sure how either Win11 or PopOS uses and manages memory but maybe win11 is intentionally using more memory for good not evil? I know that an integrated GPU uses memory for graphics but I don't know how this is allocated or managed by the two OS (is that strictly set in BIOS or does the OS dynamically change ram allocated to the iGPU as required? I would find a video that looks at these things and explains the difference between how operating systems manage memory really interesting, follow up video maybe?
@tenfourproductionsllc
@tenfourproductionsllc 2 жыл бұрын
Yup. Typing this right now on a 1gb RAM tablet that runs Windows 10. And that includes having youtube open on a web browser on that tablet.
@rautamiekka
@rautamiekka 2 жыл бұрын
1) Yes, you can use a swap partition on a Linux but it's deprecated due to - the cost of partition border crossing. - not having any benefits. - partitions wasting some disk space. - pretty sure something else I forgot. 2) The RAM amount directly affects how much is used for caching, especially on Linux. Linux is much less hesitant using RAM for caching, which is especially notable on a firewall distro cuz they'll use it all for performance (but will give you what you ask for).
@westlyward2504
@westlyward2504 2 жыл бұрын
I'm pretty sure swap partitions are still the main, with swap files being used less.
@GaryExplains
@GaryExplains 2 жыл бұрын
@rautamiekka Do you have a link to show that swap partition are deprecated? Also, you know that Linux isn't hesitant or eager to swap, it depends on the value you set for swappiness.
@milutinke
@milutinke 2 жыл бұрын
Video on Virtual Memory would be awesome
@harshgawali5154
@harshgawali5154 2 жыл бұрын
Pls compare windows and mac memory management 🙏
@un_tizio_a_caso2701
@un_tizio_a_caso2701 2 жыл бұрын
On my debian11 with a lot of programs (and libraries) installed I use only 540 MB of ram
@reki353
@reki353 2 жыл бұрын
So I don't know if you took into account windows superfetch... It keeps programs and stuff loaded that it thinks you will use next so it's faster to startup... You can turn this off and there will be a huge ram decrease.
@GaryExplains
@GaryExplains 2 жыл бұрын
Superfetch doesn't alter the RAM used on a per process basis like during the render test.
@thedeemon
@thedeemon 2 жыл бұрын
Would be nice to explain what exactly you compared. Memory used by a program is not a single simple number. In Windows Task Manager you can see columns like Working set, Active private working set, Private working set, Shared working set, Commit size, Paged pool, NP pool. Which one of them did you use? How are you sure it's the right parameter to compare with Linux? In Linux top will also give several numbers: VIRT, RES, and SHR. If you compare different things you get different results, but that's not informative at all for a comparison.
@deViant14
@deViant14 2 жыл бұрын
Right. You can safely ignore most of this video by the fact that we already know Windows and Ubuntu perform similarly in actual usage metrics. So it's likely these numbers don't mean what he thinks they mean.
@slomosapien9243
@slomosapien9243 2 жыл бұрын
I second this. First thing that got me was the 4GB+ memory usage on reboot on W11. I run W11 too and booted up with a few programs and stuff running in the background (antivirus, anydesk etc nothing huge) and the actual physical memory in use is roughly 3.3GB. The system commit which is at about 6GB corresponds with my page file also being 6GB. So maybe he used that number. Speaking under correction :D
@klaxoncow
@klaxoncow 2 жыл бұрын
Another thing to note is that he hasn't tried testing Windows and Linux with different amounts of total RAM. This does matter, as Windows does somewhat modify its behaviour - how conservative to be with RAM - based on the total RAM. If it sees 4GB total RAM, then it behaves more conservatively than if it sees 32GB of total RAM. It's not a vast difference, mind you, but there is a "less RAM = be more conservative, more RAM = stretch out a bit more and prioritise performance instead, as there's room to expand into" slightly modified behaviour in there, which further brings these results into question when you've not tested multiple RAM configurations (on both systems) to see if this does modify OS behaviour. If it sees more RAM, then it'll use more. Cache up more stuff. Prefetching stuff. So if you run Windows on a more RAM-limited system, then it uses less and behaves more conservatively about what to keep around in RAM. (This is why some people are saying "when I boot Windows, it's not taking about 4GB of RAM, as we see in these results". Yeah, because Windows has seen the total RAM and is being more conservative with its usage. Try it on a machine with, say, 32GB of RAM and it'll be less "precious" about those bytes and instead prioritises better performance, by trying to load and prefetch more of the OS into RAM - because you can afford it and this'll make it perform better.)
@deViant14
@deViant14 2 жыл бұрын
@@klaxoncow true. Windows aggressively pushes things out of RAM to keep it exactly at no more than 80% usage if possible, for example.
@slomosapien9243
@slomosapien9243 2 жыл бұрын
@@klaxoncow I agree with all you have said here. In a lot of cases unused RAM is wasted RAM (can't remember who said that lol). Cheers mate!
@vj.joseph
@vj.joseph 2 жыл бұрын
Would like to see a comparison on win 10 and win11 ram usage
@mandolinic
@mandolinic 2 жыл бұрын
Definitely want a video on VM please.
@GaryExplains
@GaryExplains 2 жыл бұрын
Already published! 👍
@Flankymanga
@Flankymanga 2 жыл бұрын
I think a video on virtual memory would be nice.
@goldnoob6191
@goldnoob6191 2 жыл бұрын
Yup!
Windows vs Linux
23:10
Gary Explains
Рет қаралды 89 М.
LINUX is BETTER than macOS in these 5 areas!
17:50
The Linux Experiment
Рет қаралды 146 М.
Can you beat this impossible game?
00:13
LOL
Рет қаралды 39 МЛН
[柴犬ASMR]曼玉Manyu&小白Bai 毛发护理Spa asmr
01:00
是曼玉不是鳗鱼
Рет қаралды 47 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 44 МЛН
Cat story: from hate to love! 😻 #cat #cute #kitten
00:40
Stocat
Рет қаралды 14 МЛН
Linux is Too Hard - A Solution!
13:05
Mental Outlaw
Рет қаралды 293 М.
10 ways Linux is just better!
11:32
Linus Tech Tips
Рет қаралды 3,9 МЛН
What is Virtual Memory? MMU, Page Tables, and more!
19:21
Gary Explains
Рет қаралды 32 М.
Why I don't recommend Ubuntu anymore
13:36
The Linux Experiment
Рет қаралды 975 М.
Arm vs RISC V- What You Need to Know
22:19
Gary Explains
Рет қаралды 299 М.
My Thoughts on Linux - The Pros and Cons
11:56
Tech With Tim
Рет қаралды 52 М.
Is Android really just Linux? - Gary explains
8:54
Android Authority
Рет қаралды 180 М.
Install Linux instead of Windows 11 - Here's how!
15:10
Linus Tech Tips
Рет қаралды 3,7 МЛН
Is Linux Mint BETTER Than Windows?
6:27
Techquickie
Рет қаралды 1,9 МЛН
Microsoft Is Destroying Linux - WSL & WSL2 Are Evil!
1:07:41
eBuzz Central
Рет қаралды 16 М.
Can you beat this impossible game?
00:13
LOL
Рет қаралды 39 МЛН