Windows: RAM) To The Applications That Run On The Computer
Windows: RAM) To The Applications That Run On The Computer
Virtual memory is how our OS provides the physical memory available in our computer (like
RAM) to the applications that run on the computer. It does this by creating a mapping, a virtual to
physical addresses.
This makes life easier for the program, which needs to access memory since it doesn't have to worry
about what portions of memory other programs might be using.
It also doesn't have to keep track of where the data it's using is located in RAM.
Virtual memory also gives us the ability for our computer to use more memory than we physically have
installed.
To do this, it dedicates an area of the hard drive to use a storage base for blocks of data called pages.
When a particular page of data isn't being used by an application, it gets evicted. Which means it gets
copied out of memory onto the hard drive.
Windows
1. Use an administrator account to log on to Windows 10.
2. From the desktop screen, right-click the Start button to open its context menu.
3. Click System.
4. From the left pane of the System window, click Advanced system settings.
5. On the System Properties box, ensure that you are on the Advanced tab.
6. Click the Settings button from under the Performance section.
You can use any amount of disk space to create a swap file. But mostly we will use space as per the RAM
space or double of RAM memory. I have 2GB of RAM so I will create 4GB of Swap memory. For creating
a swap file, we are using “dd” command.
In above command, I have created swapfile under “/data” directory and using block size 2048M & a
count is “2” which means dd will run count of 2 and create swapfile with 4GB of size.
Another way, sometimes using huge block size produce error so you can use below command. where
you will be using block size “1M” and a count is 4096. This “dd” command also create a swapfile with
“4GB” of space.
Now run mkswap command on swapfile which will tell your system to create swap space.
$ mkswap /data/swapfile
no label, UUID=e2f1e9cf-c0a9-4ed4-b8ab-714b8a7d6944
3. ENABLE SWAP
Now we have swap space available on the system. Make it enable using swapon command.
$ swapon /data/swapfile