Solved

virtural memory test

Posted on 1997-05-16
1
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

763 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