Solved

virtural memory test

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET how to use the Vertical ScrollBar 5 103
How do you programatically show and hide the Windows 10 On-Screen-Keyboard? 3 648
if loop in java 3 138
lucky13 challenge 11 140
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

816 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

12 Experts available now in Live!

Get 1:1 Help Now