Your favorite left sidebar content goes here




Swapfile

Take two “competing” operating systems: linux and windows. Both of them use what is called virtual memory. It works like this: RAM is where running code is placed to be executed. It is important that code is executed from RAM for speed reasons. However, often times, the total size of executable code in open programs is greater than the amount of physical ram available. When this happens, they system tries to decide what code from the program it will need to execute, puts that in RAM, and then stores the rest on the hard drive. When it needs code from the hard drive, it tries to swap it out in exchange for code it no longer needs.

In windows, the hard drive space is called the PageFile. And this is an actual file on the hard drive (typically in C:\ in basic home systems.) On linux this is an actual partition on the hard drive (I haven’t used linux hard-core in a while, so there may be other methods too).

Recently, I’ve had to determine why a large SQL Server randomly decides to consume all resources and become unresponsive. My first thought was the PageFile. Sure enough, the PageFile was way too small (the system wouldn’t have room to swap executable code). So we increased the PageFile. In windows, since it is a file in the file system, it’s no biggie, just change some preferences. In linux, this would be a larger issue: you’d have to format specific parts of your drive for that, and if they were already formatted, would get icky.

So it was really nice in windows: just make it bigger. In linux, it would be messy. However, in linux, you specifically tell it at install how much swap space you need. While windows makes it easier after the fact, it was neglected when the server was made. It should not have been.

So, plus for windows: easy to fix. Plus for linux: you would’ve thought about it before it was a problem.


3K2 theme by Hakan Aydin