0% found this document useful (0 votes)
63 views

Windows: RAM) To The Applications That Run On The Computer

The document discusses virtual memory and swap space. Virtual memory allows the operating system to use hard drive space like RAM by moving rarely used memory pages to the hard drive to free up space in physical RAM. When an application needs a page that was swapped out, it is swapped back into RAM from the hard drive. Swap space is an area of the hard drive designated for this virtual memory usage. The document provides instructions for configuring swap space in Windows and Linux systems.

Uploaded by

Zargham Durrani
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Windows: RAM) To The Applications That Run On The Computer

The document discusses virtual memory and swap space. Virtual memory allows the operating system to use hard drive space like RAM by moving rarely used memory pages to the hard drive to free up space in physical RAM. When an application needs a page that was swapped out, it is swapped back into RAM from the hard drive. Swap space is an area of the hard drive designated for this virtual memory usage. The document provides instructions for configuring swap space in Windows and Linux systems.

Uploaded by

Zargham Durrani
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Before we talk about swap space, let's talk about the concept of virtual memory.

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.

7. On the Performance Options box, go to the Advanced tab.


8. Click the Change button from under the Virtual memory section.
9. On the Virtual Memory box, uncheck the Automatically manage paging file size for all drives
checkbox.
10. From the available list, click to select the drive on which Windows 10 is installed. (C: in most
cases.)
11. From below the list, click to select the Custom size radio button.
12. In the now-enabled fields, type the minimum and maximum size of the Page file in megabytes
(MB) according to the physical memory present in your computer.
13. Click Set and then click OK.
14. Restart your computer when you're done.
Linux
1. CREATE SWAP

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.

$ dd if=/dev/zero of=/data/swapfile bs=2048M count=2

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.

$ dd if=/dev/zero of=/data/swapfile bs=1M count=4096

2. USE MKSWAP COMMAND

Now run mkswap command on swapfile which will tell your system to create swap space.

$ mkswap /data/swapfile

Setting up swapspace version 1, size = 4194300 KiB

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

You might also like