Wednesday, October 22, 2014

Page Fault Driven Heap Size

1 A Page Fault Equation for Dynamic Heap Sizing

http://www.math.nus.edu.sg/~mattyc/HeapSizing.pdf

This is an interesting paper. It more or less presents an equation,

1.1 Introduction

H is the heap size, M is the size of available main memory

1.1.1 Suggested policy out-performs JikesRVM's heap size mamager

1.1.2 The Problem:

  1. Frequent GC pauses in a small heap leads to significant performance degredation due to cache pollution.
  2. A large heap faces frequent page faults.
    1. GC actually causes more page faults than the mutator when the heap size exceeds main memory.
  3. Tuning intelligently can possibly lead to better performance that manual memory management can provide.
  4. Heap cannot be static, must be able to scale to very small and very large heaps.
  5. The number of page faults not simply a function of actual memory and of heap size, includes mutator + collector behavior.
    1. Since hard to isolate behavior's effects, simply considering rate of page faults.

1.1.3 Heap-Aware Page Fault Equation

  1. Equation takes parameters specific to mutator, GC, and OS
  2. See paper for equation.
  3. Refinement of the existing general "page fault equation"

1.1.4 General Page Fault Equation:

  1. "A page fault equation for modeling the effect of memory size" by Tay and Zou
  2. Note: Paper with restricted viewership rights

1.1.5 Heap sizing Rule:

  1. Uses the parameters for the page fault equation to know how to resize.
  2. Doesn't require OS or hardware modification or costly setup of polling, handlers, and callbacks for stalls and page references.
  3. Can automatically respond to changes in main memory(cloud hosting?)
  4. Allows for hotswapping of collectors if parameters found.

1.2 Heap-Aware Page Fault Equation:

1.2.1 Page Fault Equation

  1. Takes a number of variables that must be found or estimated.

1.2.2 Paper describes parameters in general equation

1.2.3 GC-specific parameters

  1. Centers around M*, the memory usage of the heap.
    1. Used in consideration of paging equation, which considers the page fault rate as a function of the actual memory and the program's memory usage.
  2. M* = aH + b
    1. We expect the memory footprint to grow as a linear function of the heap size
    2. b = Measure of space overhead of collector / VM outside of heap.

1.2.4 Experimental Validation

  1. No existing classical page fault analysis models able to account for thrashing effect of small page sizes, and the respective increase in performance by allowing a slightly larger-than-necessary heap.
  2. Experimental evidence suggests that the page fault equation and heap resizing policy both hold.

1.2.5 Can derive a Hmin, the smallest reasonable heap.

1.3 Heap Sizing

1.3.1 Heap sizing rule

  1. Heap sizing rule falls out of the H > Hmin, H < Hmax requirements.

1.3.2 Experiments with static memory size

  1. Consistently has less page faults for JikesRVM vs default resizing policy.
  2. Since page faults will dominate execution time, also faster

1.3.3 Experiments with variable memory size

  1. Outperforms Jikes significantly.

Created: 2014-10-22 Wed 16:57

Emacs 24.4.1 (Org mode 8.2.10)

Validate

No comments:

Post a Comment