![]() The portions of RAM that accelerate disk read are called "cached memory." You will notice that they make a huge difference in terms of responsiveness. Optimizing memory usage Since mechanical hard drives are considerably slower than RAM (SSD - Solid State Drive - storage is not as slow as physical drives, but still slower than RAM), when you need a file (be it a data file like a video, executables like Firefox, or libraries), the Linux kernel reads the file into RAM and keeps it there, so that the next time you need it, it is already in RAM and data access is much faster. ![]() In these cases, swap can give you an extra delay to figure out what happened, or to finish what you are working on. Unforeseeable Circumstances Unforeseeable events can and will happen (a program going crazy, some action needing much more space than you thought, or any other unpredictable combination of events). In both alternatives (PM-UTILS or SYSTEMD) you may use a partition or a file. Although the latest versions of Ubuntu don't support hibernation OOTB you may configure your system to allow Hibernation. Therefore, your swap partition should be at least as big as your RAM size. Hibernation (suspend-to-disk) The hibernation feature (suspend-to-disk) writes out the contents of RAM to the swap partition before turning off the machine. ![]() In these cases, swap will be used to help the system handle any extra load. The system can swap out those pages and free the memory for other programs or even for the disk cache. A significant number of the pages used by these large programs during its startup may only be used for initialization and then never used again. Memory consuming programs Sometimes, a large program (like LibreOffice, Neverwinter Nights, or a video editor) make the entire system need extra memory. Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap file(s). Do not consider it to be a complete replacement for the physical memory. Note that the access time for swap is slower, depending on the speed of the hard drive. When this happens, inactive pages from the physical memory are then moved into the swap space, freeing up that physical memory for other uses. Swap space is used when your operating system decides that it needs physical memory for active processes and the amount of available (unused) physical memory is insufficient. Swap holds memory pages that are temporarily inactive. It is a part of your machine's Virtual Memory, which is a combination of accessible physical memory (RAM) and the swap space. You will be given very simple answers (to prevent losing too much time reading this FAQ) and some explanations that may help you form your own opinion.This FAQ will tell you how much swap you need and how to add more swap after installation.People always wonder how much swap they should create at install time, or after installing they may think, "have I made a large enough swap? Should I reinstall with a larger swap?".What is the priority of swap containers?.What is swappiness and how do I change it?.How do I add or modify a swap partition?.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |