Alan Kaminsky Department of Computer Science Rochester Institute of Technology 4486 + 2220 = 6706
Home Page
Operating Systems I 4003-440-02 Winter Quarter 2012
Course Page

4003-440-02 Operating Systems I
Memory Trace Analysis

Prof. Alan Kaminsky -- Winter Quarter 2012
Rochester Institute of Technology -- Department of Computer Science


Classes for Analyzing Memory Traces


Dumping a Memory Trace


Plotting a Memory Trace

  • Package edu.rit.os1.trace.test

  • Class TracePlot displays a plot of a memory trace. The trace is read from a file using a TraceInputStream. The horizontal axis measures the memory accesses. The vertical axis measures the memory address, with 0.0 representing address 00000000 and 1.0 representing address FFFFFFFF; the upper bound address can be specified on the command line. To speed up displaying the plot, the trace data is binned. Horizontally, each group of 10,000 trace entries goes in one bin; the number of entries in a bin can be specified on the command line. Vertically, the address range is divided into 65,536 bins.

    Usage: java edu.rit.os1.trace.test.TracePlot tracefile [ addrub [ hbin ] ]
    tracefile = Trace file
    addrub = Hexadecimal address corresponding to 1.0 on the vertical axis (default FFFFFFFF)
    hbin = Number of trace entries per horizontal bin (default 10,000)


Sample Memory Traces

These memory trace files are courtesy of Prof. Douglas Thain at the University of Notre Dame. According to Prof. Thain, "Each trace is a real recording of a running program, taken from the SPEC benchmarks. Real traces are enormously big: billions and billions of memory accesses. However, a relatively small trace will be more than enough to keep you busy. Each trace only consists of one million memory accesses taken from the beginning of each program."
(http://www.cse.nd.edu/~dthain/courses/cse341/spring2005/projects/memory/)

The memory trace files have been reformatted and compressed to work with class TraceInputStream.

  • bzip.trace.dat (193,681 bytes)

  • gcc.trace.dat (1,473,937 bytes)

  • sixpack.trace.dat (1,210,688 bytes)

  • swim.trace.dat (1,285,254 bytes)

  • java edu.rit.os1.trace.test.TracePlot bzip.trace.dat 3FFFFFFF

  • java edu.rit.os1.trace.test.TracePlot gcc.trace.dat 3FFFFFFF

  • java edu.rit.os1.trace.test.TracePlot sixpack.trace.dat 3FFFFFFF

  • java edu.rit.os1.trace.test.TracePlot swim.trace.dat 3FFFFFFF


Page Replacement Algorithm Simulation

  • Package edu.rit.os1.trace

  • Package edu.rit.os1.trace.test

  • Program VM does a virtual memory (VM) simulation of a memory trace. The page replacement algorithm is specified on the command line by giving the fully qualified class name of a subclass of class VMSimulator. The trace is read from a file using a TraceInputStream. The simulation is performed with a fixed page frame size and a range of numbers of available page frames. The program plots miss ratio versus number of available page frames. This shows the proportion of memory accesses that caused page faults. The program also plots miss ratio plus dirty-page miss ratio. This shows disk activity; if a dirty page is selected for replacement, it requires an extra disk access to copy the dirty page back to disk.

    Usage: java edu.rit.os1.trace.test.VM simclassname tracefile pfsize pfmin pfmax pfincr
    simclassname = Fully qualified class name of VM simulator
    tracefile = Trace file
    pfsize = Each page frame contains 2pfsize addresses
    pfmin = Minimum number of available page frames
    pfmax = Maximum number of available page frames
    pfincr = Number of available page frames increment


Simulation of Page Replacement Algorithms for bzip

  • java edu.rit.os1.trace.test.VM edu.rit.os1.trace.OptSimulator bzip.trace.dat 12 10 500 10 > bzipopt.txt

  • java edu.rit.os1.trace.test.VM edu.rit.os1.trace.LruSimulator bzip.trace.dat 12 10 500 10 > bziplru.txt

  • java edu.rit.os1.trace.test.VM FifoSimulator bzip.trace.dat 12 10 500 10 > bzipfifo.txt

  • java edu.rit.os1.trace.test.VM SecondChanceSimulator bzip.trace.dat 12 10 500 10 > bzipsc.txt

OPT LRU FIFO Second Chance


Simulation of Page Replacement Algorithms for gcc

  • java edu.rit.os1.trace.test.VM edu.rit.os1.trace.OptSimulator gcc.trace.dat 12 10 500 10 > gccopt.txt

  • java edu.rit.os1.trace.test.VM edu.rit.os1.trace.LruSimulator gcc.trace.dat 12 10 500 10 > gcclru.txt

  • java edu.rit.os1.trace.test.VM FifoSimulator gcc.trace.dat 12 10 500 10 > gccfifo.txt

  • java edu.rit.os1.trace.test.VM SecondChanceSimulator gcc.trace.dat 12 10 500 10 > gccsc.txt

OPT LRU FIFO Second Chance


Simulation of Page Replacement Algorithms for sixpack

  • java edu.rit.os1.trace.test.VM edu.rit.os1.trace.OptSimulator sixpack.trace.dat 12 10 500 10 > sixpackopt.txt

  • java edu.rit.os1.trace.test.VM edu.rit.os1.trace.LruSimulator sixpack.trace.dat 12 10 500 10 > sixpacklru.txt

  • java edu.rit.os1.trace.test.VM FifoSimulator sixpack.trace.dat 12 10 500 10 > sixpackfifo.txt

  • java edu.rit.os1.trace.test.VM SecondChanceSimulator sixpack.trace.dat 12 10 500 10 > sixpacksc.txt

OPT LRU FIFO Second Chance


Simulation of Page Replacement Algorithms for swim

  • java edu.rit.os1.trace.test.VM edu.rit.os1.trace.OptSimulator swim.trace.dat 12 10 500 10 > swimopt.txt

  • java edu.rit.os1.trace.test.VM edu.rit.os1.trace.LruSimulator swim.trace.dat 12 10 500 10 > swimlru.txt

  • java edu.rit.os1.trace.test.VM FifoSimulator swim.trace.dat 12 10 500 10 > swimfifo.txt

  • java edu.rit.os1.trace.test.VM SecondChanceSimulator swim.trace.dat 12 10 500 10 > swimsc.txt

OPT LRU FIFO Second Chance

Operating Systems I 4003-440-02 Winter Quarter 2012
Course Page
Alan Kaminsky Department of Computer Science Rochester Institute of Technology 4486 + 2220 = 6706
Home Page
Copyright © 2013 Alan Kaminsky. All rights reserved. Last updated 01-Feb-2013. Please send comments to ark­@­cs.rit.edu.