wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Virtual memory

profile
Khushi Upadhayay
Aug 15, 2024
0 Likes
0 Discussions
85 Reads

VIRTUAL MEMORY

What is virtual memory?

Virtual memory is a memory management technique where secondary memory can be used as if it were a part of the main memory. Virtual memory is a common technique used in a computer’s operating system (OS).

Virtual memory uses both hardware and software to enable a computer to compensate for physical memory shortages, temporarily transferring data from random access memory (RAM) to disk storage. Mapping chunks of memory to disk files enables a computer to treat secondary memory as though it were main memory.

Virtual memory is important for improving system performance, multitasking and using large programs. However, users should not overly rely on virtual memory, since it is considerably slower than RAM. If the OS has to swap data between virtual memory and RAM too often, the computer will begin to slow down – this is called thrashing.

Virtual memory was developed at a time when physical memory – also referenced as RAM – was expensive. Computers have a finite amount of RAM, so memory will eventually run out when multiple programs run at the same time. A system using virtual memory uses a section of the hard drive to emulate RAM. With virtual memory, a system can load larger or multiple programs running at the same time, enabling each one to operate as if it has more space, without having to purchase more RAM.

How virtual memory works

Virtual memory uses both hardware and software to operate. When an application is in use, data from that program is stored in a physical address using RAM. A memory management unit (MMU) maps the address to RAM and automatically translates addresses. The MMU can, for example, map a logical address space to a corresponding physical address.

If, at any point, the RAM space is needed for something more urgent, data can be swapped out of RAM and into virtual memory. The computer’s memory manager is in charge of keeping track of the shifts between physical and virtual memory. If that data is needed again, the computer’s MMU will use a context switch to resume execution.

While copying virtual memory into physical memory, the OS divides memory with a fixed number of addresses into either pagefiles or swap files. Each page is stored on a disk, and when the page is needed, the OS copies it from the disk to main memory and translates the virtual addresses into real address.

What are the limitations of using virtual memory?

Although the use of virtual memory has its benefits, it also comes with some tradeoffs worth considering, such as:

Applications run slower if they are running from virtual memory.

Data must be mapped between virtual and physical memory, which requires extra hardware support for address translations, slowing down a computer further.

The size of virtual storage is limited by the amount of secondary storage, as well as the addressing scheme with the computer system.

Thrashing can occur if there is not enough RAM, which will make the computer perform slower.

It may take time to switch between applications using virtual memory.

It lessens the amount of available hard drive space.

What are the benefits of using virtual memory?

The advantages to using virtual memory include:

It can handle twice as many addresses as main memory.

It enables more applications to be used at once.

It frees applications from managing shared memory and saves users from having to add memory modules when RAM space runs out.

It has increased speed when only a segment of a program is needed for execution.

It has increased security because of memory isolation.

It enables multiple larger applications to run simultaneously.

Allocating memory is relatively inexpensive.

It does not need external fragmentation.

CPU use is effective for managing logical partition workloads.

Data can be moved automatically.

Pages in the original process can be shared during a fork system call operation that creates a copy of itself.

Process in a blocking state. For the execution to proceed the OS must bring the required page into the memory.

The OS will search for the required page in the logical address space.

The required page will be brought from logical address space to physical address space. The page replacement algorithms are used for the decision-making of replacing the page in physical address space.

The page table will be updated accordingly.

The signal will be sent to the CPU to continue the program execution and it will place

the process back into the ready state.


Comments ()


Sign in

Read Next

DIGITAL ECONOMY

Blog banner

You Get Everyone, But No One Gets You: The Lonely Side of High Emotional Intelligence

Blog banner

LIFEHACKER

Blog banner

Koinex is shutting down and here is how you can withdraw...

Blog banner

Memory Management

Blog banner

Security Issues and Countermeasures

Blog banner

Microsoft powerpoint presentation

Blog banner

Understanding Gen Z: A Generation Facing Crisis and Potential

Blog banner

The Features of Blockchain

Blog banner

SPEM

Blog banner

Google App Engine

Blog banner

Service Operations in ITSM

Blog banner

The Impact of Cyber Forensics on Corporate Governance and Compliance

Blog banner

Things You Should Leave Behind In 2025, Whilst In 2026

Blog banner

File management

Blog banner

Big Data

Blog banner

Development Of Modern Operating System

Blog banner

Denial-of-Service and Distributed Denial-of-Service Attack Techniques

Blog banner

Security issues

Blog banner

Real Time Scheduling

Blog banner

Memory heirachy (Operating system)

Blog banner

How to invest in Indian Stock Market ? ~ Tutorial 1

Blog banner

GEOLOGY AND GEO-TECTONIC FRAME WORK OF WESTERN BASTAR CRATON

Blog banner

Linux -V Server Virtual Machine

Blog banner

Is it important to follow all the trends that come up on social media?

Blog banner

Article on IT development trends

Blog banner

Modern Operating system

Blog banner

How Cyber Forensics use in AI

Blog banner

EID UL FITR

Blog banner

The New Dr. Frankenstein who will perform first full head transplant

Blog banner

Article on Team Work

Blog banner

A Tourist’s Guide To Florida’s Rodeo Culture: What To Expect At The Arcadia Championship Rodeo

Blog banner

Business-to-Business

Blog banner

Different memory allocation strategies

Blog banner

Sweet Mango Murabba

Blog banner

Data-Driven Prediction of Virtual Item Prices in Online Games

Blog banner

The House ??of Patola Designs: Traditional Weaves with a Modern Twist

Blog banner

MODERN OPERATING SYSTEM

Blog banner

VIRTUAL MEMORY

Blog banner

Microsoft Word

Blog banner

Constrains in service design

Blog banner

Multiprocessor and Multicore Organization

Blog banner