Earlier quoted context omitted.
Care to explain why this is so?
Stop measuring your swap space in terms of disk space, start imagining it in terms of "amount of time it takes to fill up". At a nice round 20MB/sec write, it would take a solid 400 seconds to use that much swap at full speed. In reality, you can't fill it that fast either, because it's seeking, also yanking other stuff out to run your other processes, and then sticking the stuff back in to run those other processes,…
Tired of explaining Linux's seemingly obtuse memory usage to confused newbies?
61–70 of 74 posts
Re: Tired of explaining Linux's seemingly obtuse memory usage to confused newbies?
#62Re: Tired of explaining Linux's seemingly obtuse memory usage to confused newbies?
#63Hmm, this situation is like owning an electric vehicle. The manufacturers are passionate about technology, and they invented a flywheel that can store massive amounts of energy, giving your vehicle incredible transient acceleration response. They ship many vehicles with this new feature, but unfortunately, they forgot to account for what this would do to the battery charge display after starting. As a result, their r…
Re: Tired of explaining Linux's seemingly obtuse memory usage to confused newbies?
#64The title of the link (unlike the linked page) suggests that Linux is somehow to blame here... Why? Using RAM for disk caching is a good thing . Besides, this technique is employed by Windows as well. It's just that the average Windows user probably doesn't know how much free RAM his PC has (well, the really average user doesn't know how much total RAM it has). My Windows 7 box takes at least 2GB of memory to itself…
Re: Tired of explaining Linux's seemingly obtuse memory usage to confused newbies?
#65Never say never. You can and should disable/purge linux buffer caching in certain situations. See O_DIRECT and/or POSIX_FADV_DONTNEED. If I'm writing a database, I take care of my own caching, I do not need the OS doing it as well. Also, if I'm doing a huge rsync of a directory tree, just because I just read every byte of every file in that tree, I most certainly do not want to load all of that crap into the linux buffer cache. It will evict my already warm set, as well as potentially cause a ton of swapping.
Re: Tired of explaining Linux's seemingly obtuse memory usage to confused newbies?
#66Earlier quoted context omitted.
Hibernation requires a large swap space, doesn't it? Last I knew it did, perhaps you can compress it now.
Yes, and it may seem a merely semantic difference, but there's still a difference between "swap space" and "hibernation backing". One I'm willing to wait for while it fills, the other, I am not. The kernel may not distinguish, but I do. When I don't care about hibernation I just remove it.
Re: Tired of explaining Linux's seemingly obtuse memory usage to confused newbies?
#67Earlier quoted context omitted.
Stop measuring your swap space in terms of disk space, start imagining it in terms of "amount of time it takes to fill up". At a nice round 20MB/sec write, it would take a solid 400 seconds to use that much swap at full speed. In reality, you can't fill it that fast either, because it's seeking, also yanking other stuff out to run your other processes, and then sticking the stuff back in to run those other processes,…
Please note that this doesn't apply all the same to servers. I have servers running with 16 GB of RAM and 16 GB of swap (because I simply can't even stop them to add RAM), and even then about twice a year they run out of memory and the OOM killer does its dirty job. However without swap they used to simply crash and burn, so swap is fine in this case.
Re: Tired of explaining Linux's seemingly obtuse memory usage to confused newbies?
#68This is misleading, as the kernel will often swap out processes rather than shrink the disk cache. Its tendency to do this is controlled by the vm.swappiness parameter, which by default heavily favors swapping: http://kerneltrap.org/node/3000 Decreasing this value will favor reducing the cache size and will tend to increase responsiveness. You can set it in the /etc/sysctl.conf file. Low values (≤ 5) are especially g…
Re: Tired of explaining Linux's seemingly obtuse memory usage to confused newbies?
#69Hmm, this situation is like owning an electric vehicle. The manufacturers are passionate about technology, and they invented a flywheel that can store massive amounts of energy, giving your vehicle incredible transient acceleration response. They ship many vehicles with this new feature, but unfortunately, they forgot to account for what this would do to the battery charge display after starting. As a result, their r…
If only electric cars were free like Linux.
Re: Tired of explaining Linux's seemingly obtuse memory usage to confused newbies?
#70You can't disable disk caching. The only reason anyone ever wants to disable disk caching is because they think it takes memory away from their applications, which it doesn't! Disk cache makes applications load faster and run smoother, but it NEVER EVER takes memory away from them! Therefore, there's absolutely no reason to disable it! Never say never. You can and should disable/purge linux buffer caching in certain…
--cache
Apple specific option to enable filesystem caching of rsync file
i/o Otherwise fcntl(F_NOCACHE) is used to limit memory growth.