Solved

virtural memory test

Posted on 1997-05-16
1
192 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

Independent Software Vendors: 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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

737 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