Solved

virtural memory test

Posted on 1997-05-16
1
177 Views
Last Modified: 2013-12-26
Hi, I am 16  year old mac head starting to learn how to program, I have
just been through "Learn C on the Mac" by Dave Mark and wanted to use some
of my knowledge on a science project for high school.

One idea I have is the

 "Performance difference between Real and Virtual memory"

There's a few things I need help with to develop this experiment and hope
someone can spare a little of their time to help me out on them.

Is it possible to store something in a high address, so that it is on the
hard drive instead of the real RAM, or would I get the same results by
storing data in a file and the same data in memory and just comparing the
time taken for each to load. I plan to measure speed difference by calling
the time() function when I request the data and again after the data is
loaded. Is there a more precise way of measuring the time. ticks?.

Please give me advise on better ways to carry out this project.

Thanks

Roneel.
0
Comment
Question by:roneel
1 Comment
 
LVL 1

Accepted Solution

by:
PAD earned 50 total points
ID: 1291468
As far as i know, there is no way to know that some piece of memory are on disk. Virtual memory hide this for you and when you access a memory adress it bring it in Real RAM if it was not.

Second, simulating virtual memory access with read/write into files is not the exact way because VM is highly optimized and do not use high level routine from File Manager so this not the same performance.

One thing you can do is to develop an application that use lot of memory, launch it several time to fill you mac's memory and measure time to switch from an app to the other. Doinf this with Real RAM only and VM will give you an experience of performance.

Good luck

Another thing, Time() will give you a time measure with a poor precision (1 seconds), you'll better use clock() (1/60 th of seconds) or even MicroSeconds (more complicate to use but more precise, you can deal with 1/1000 et of 1/100000 th of seconds).
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

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 29
Detect CR LF to each line 12 154
canBalance challenge 34 70
Line meaning 9 82
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

25 Experts available now in Live!

Get 1:1 Help Now