 Hey everybody, welcome back to the channel today I'm going to be talking a little bit about swap space now you're probably wondering why this question has come up and the answer is I just want to talk a little bit about it because Really the question isn't whether or not you need swap space But whether or not you need swap space if you have a ton of memory So if you're running a system, I guess before we get into this we should talk a little bit about what swap space is It's a little complicated. So just just bear with me. I'm going to try to simplify as much as possible Swap space is basically a partition on your hard drive that allows your system to save stuff To it after you've used all the RAM in your system So if your noodle links and you don't I'm assuming at least that you know what right RAM is versus ROM Okay, so basically RAM is the memory that Stores things that are running on your system and gets flushed out every time your computer gets shut off and then you know Your hard drive which is is where the data is stored permanently and Obviously can't be flushed when just when your computer is shut off usually you were talking about Your hard drive storage of whatever is very cheap and very large whereas you probably only have 4 8 16 gigabytes of you know RAM and There's a chance that the more programs you use the more tabs you have opening Chrome or Firefox The closer you get to using up all of your RAM and if you were to you use up all of your RAM You would need on at least on Linux You'd need a swap file and what that would do is once you've reached the point of using your 4 gigabytes of RAM or Whatever your system would then be able to store some of that data onto your hard drive and treat it kind of like it would is You know memory itself It's slower obviously the memory and I don't really need need to discuss the technicalities of why it's slower But it allows you to have Technically more RAM in your system or you know virtual RAM I guess that would allow so that you can actually keep working without having to worry about you know your computer Just you know crashing or no Applications being able to launch now if you use Windows Windows does not have a swap file mechanism and I Don't know if it still happens But when I used to use Windows every once in a while I'd use up all of my memory on a like a laptop and you and you try to open up a new tab or you try to Open up a new program and Windows would actually pop up. I'm saying no more memory available Please please create up some memory That's not on Linux if on Linux if you have a swap file Available that would only happen if you've used up both your memory and your swap file So that is what swap for a swap file is it's been around for a long time and it was much more relevant when Computers only had a little bit of RAM. So if you only had you know, like 1 gigabyte or 2 gigabytes or 4 gigabytes of RAM Swap file was much more important than these days where the average Computer now has at least four. I mean, that's usually the bare minimum and Usually 8 8 is usually it seems to be the spot where most manufacturers have settled on is kind of the standard amount of RAM for computer and We're seeing more and more now with 16 gigabytes of RAM on my computer here that I use as a daily driver I have 64 gigabytes and that's just because I do video editing and stuff like that But even I you know with all the stuff that I have running right now and I'll talk about it You know probably in a few minutes. I'm only using right now like 11% of my RAM and I have a ton of stuff running I never use all of my RAM. So do I the person who has 64 gigabytes of RAM? need a swap file and the answer is Maybe If you have a ton of RAM and you don't plan on using hibernate the hibernate function Which I'll talk about in a minute. Then you don't need a swap file for the most part I mean, it doesn't hurt anything to have one Even if it's just a small one But you don't actually need it Because you're never going to hit that threshold where you oh my goodness I've used all 64 gigabytes of my RAM and now I need another 64 gigabytes of swap file That's not likely to happen and that you're doing something crazy That you probably shouldn't be doing You know with your system. I mean if you're doing something that requires you to have All 64 gigabytes of your memory you running and use in usage at the same time I don't know what to do for you, man. You got you got other problems and You're obviously doing things that are outpacing the ability of your machine You need something new and then you need to bike a Mac Mac Pro has like 1.5 terabytes or something and go with that So if for the most part The answer to the question is do you still need to need swap space if you have a ton of memory? And I would say no now the caveat to that is if you want to use the hibernate Now hibernate just basically means when you you put your machine into hibernate mode, whatever Your computer will actually take everything that's in RAM and store on your hard drive somewhere now Windows does this in a weird way I don't really understand it but in Linux If you want to use hibernate you have to have a swap file in order to take everything from RAM and put it Into on your hard drive. That's where Linux stores it is on a swap file or a swap partition If you don't have it then you can hibernate won't work So if you use hibernate, you need a swap file now the question is then I Guess we have two questions. What is the the lowest amount of RAM you'd use and still need a swap file? And I would say if you have 8 gigabytes of RAM you need a swap file. I mean you do and I would say Have an 8 gigabyte swap file that way you can double it if you have 16 I would say you still need a swap file I would say you need at least four gigabytes for your swap file, maybe eight They say about 20% I'm gonna go ahead and say 50% Unless you're at eight and then I'd say I'd say go ahead and double it now if you have more than 16 and You're using hibernate It's once you get past 16 that you can really kind of forget the swap space unless you use the hibernate function and I Will just say this out loud and just say I these are my opinions if you look on the internet If you look if you go through and Google do I need swap space? You'll find 20 million different answers Most people most Linux users will agree the ones that views it for a while that Having a swap space or swap partition swap file doesn't hurt anything So if you have space on your hard drive create one It doesn't hurt you anyways. As long as you don't create it too big. It's not going to Prevent you from storing a bunch of stuff on your drive And it is kind of like it's kind of like when you buy insurance You don't want to have to use it But it's kind of a piece of mind thing that you know that it's there and that's a good thing, right? And chances are though if you have like a really small hard drive You also probably don't have a very large amount of RAM. So It's kind of a Paradox there because you you know, you want to have a bigger swap file that you probably don't have a bigger You know drive or whatever buying a bigger hard drives cheaper than buying more memory And there's most computers don't have a limit to what how much of a hard drive you can put in them So you can put a two terabyte hard drive in a little laptop Whereas in your the motherboard that laptop might limit you to eight gigabytes of RAM So you could therefore create a bigger swap file by getting a bigger hard drive Whereas you can't necessarily always Upgrade your RAM and a lot of time is in these newer laptops. Your RAM is solid on so once you whatever you bought when you Whenever whatever you can figure when you bought your laptop That's what you're stuck at forever and ever until you get a new laptop So a swap file then is probably even more important Especially if you're at that eight or even 16 gigabyte threshold Because you know, you can't actually go through and say you want to I'm consistently using eight point, you know Whatever gigabytes of RAM and I need that extra, you know cushion just in case You can't actually go through go to best buy and buy yourself new more memory So the swap space actually becomes more important in that situation scenario so that's just a very brief Explanation of what swap is and what and answering the question of whether or not you need a swap file or swap partition Now I don't have one on my computer at all Now this is not because I don't have enough hard drive space. It's not because I Don't think it's a good idea. It's mostly because I didn't think I needed one Because I have 64 gigabytes of RAM. I never ever ever use all of them all of that RAM I mean never. I mean I could have steam going playing a game Pause in the background. I could have all my fire fuck stuff open. I could have You know right now I also have OBS and audacity running and a lot of times I do that even when I'm gaming You know, I have notion I have to do is I have discord all this stuff open up all at the same time and like I said right now I'm using 11% of my 64 gigabytes and I could even be rendering rendering a video in the background You know in Caden live and probably only go get up go up to 35 or you know 40% I don't think I've ever seen it go over 50 Maybe one time when I was building a city skylines video did it go over like 30 gigabytes? I think maybe and City skylines is notoriously not well optimized So I don't have one for that reason and I don't use hibernate So I don't I really didn't think I needed one so That's just you know my situation if you like this video give it a thumbs up if you didn't give it a thumbs down Let me know in the comments if you have a swap file and if you ever actually had to use it I'm very curious. Well because I have had I have computers actually still now that have swap files And I don't know that I've ever actually driven my computer to actually having to use it Maybe I just don't I'm just not a power user off. Anyways, I let me know about that in the comments If you want to support the channel, you can do so by subscribing Going to patreon.com slash linux cast or follow links on Twitter or Facebook or whatever We really do appreciate everybody who subscribes So we're trying to get to a thousand subscribers by the end of the year and if you could subscribe I'd be very much appreciative of that And I'll see you next time. Thanks for watching