Solved

Virtual Memory

Posted on 1998-05-18
3
258 Views
Last Modified: 2013-11-15
Hi,
   I think I pretty much understand virtual memory, but I need an example of a program which would run very efficiently on a virtual memory system, and one which definitely wouldn't. Also a quick explanation of why would be appreciated.
Cheers.
0
Comment
Question by:PiersBull
  • 2
3 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 1135468
Any program which makes use of a memory set which cannot be held in real memory will suffer performance degradation.  The issue is that virtual memory is orders of magnitude slower than real memory.  Once your program starts needing it, execution slows to a crawl.  Most computers today can access a word of memory in under 100nS (that's 100 X 10^-9 seconds or 1 x 10^-7 seconds).  Virtual memory is stored on the disk and most disk systems provide access times on the order of 10mS (that's 10 x 10^-3 seconds or 1 x 10^-2 seconds).  If we compare the two, we are talking about 5 orders of magnitude.  In other words, RAM access is 100,000 times faster than disk access.


0
 

Author Comment

by:PiersBull
ID: 1135469
jhance,
   Cool. I understand the massive loss in performance, but it seems that some programs work better with virtual memory than others. I need to know what type of application will utilise virtual memory better than another. I need to know as I'm preparing for final exams in C.S. at Uni, and the question has come up several times in the past.
Cheers.  
0
 
LVL 32

Accepted Solution

by:
jhance earned 50 total points
ID: 1135470
The key to maintaining reasonable performance with a large data set in virtual memory is organizing your data in memory and knowing how the system you are running on manages it's virtual memory.  By keeping your data accesses within VM pages, you can minimize VM paging and keep performance up.  For example, if you target maching uses 4K VM pages, all memory access to that 4K page will be fast (i.e. RAM speed) once that page is pulled into memory.  If, however, your application is reading/writing memory all over the place, the OS will be reading/writing pages from/to disk and will cause a symptom called "thrashing".  This is very undesirable and the system ends up spending more time moving memory in and out that it does doing your work.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now