Aspect Enabled Adaptive Garbage Collection - PowerPoint PPT Presentation

About This Presentation
Title:

Aspect Enabled Adaptive Garbage Collection

Description:

Aspectual Framework for Adaptive Garbage Collection ... Jess ... SPEC JVM98 Jess Results. Jess Garbage Collection Count. Jess Results. SPEC JVM98 Db Results ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 46
Provided by: CB73
Category:

less

Transcript and Presenter's Notes

Title: Aspect Enabled Adaptive Garbage Collection


1
Aspect Enabled Adaptive Garbage Collection
  • Darren Ng
  • David Kaeli

2
Outline
  • Introduction
  • Problem Java Performance
  • Jikes Research Virtual Machine (RVM)
  • Aspect Oriented Programming (AOP)
  • Aspectual Framework for Adaptive Garbage
    Collection
  • SPEC JVM98 Results
  • Summary
  • Future Work

3
Thesis Overview
  • Goal
  • To explore the use of aspect oriented
    programming (AOP) software engineering to enhance
    the run-time performance of the Java language.
  • More specifically, an AOP framework was created
    to enable adaptive garbage collection in the
    Jikes Research Virtual Machine (RVM).

4
Thesis Contribution
  • Detailed how aspects in the form of AspectJ can
    be integrated into the Jikes RVM for
    environmentally aware software components.
  • Described an AOP framework for adaptive Garbage
    Collection in the Jikes RVM to improve Java
    application performance.
  • Explained how the current AOP framework can be
    expanded for future software research.

5
Problem Java Performance
  • Java is an interpreted programming language.
  • A virtual machine (VM) translates Java byte-code
    into machine code.
  • A virtual machine also automatically manages heap
    memory.

6
Java Performance Cont.
  • The use of a VM consumes CPU cycles and slows
    down the execution of the Java application.
  • New Java technology is continually being
    developed to increase the performance of the
    language.
  • Just-in-time Compilation
  • New Garbage Collection Schemes

7
Garbage Collector Categories
  • Stop the World Application program is paused
    while the garbage collector is active.
  • Incremental Interleaves partial garbage
    collection with application execution.
  • Concurrent Application and collector may
    operate simultaneously
  • Real-Time Garbage collection time is bounded by
    a guaranteed small time constant to minimize the
    application pause time.

8
Garbage Collection Terms
  • Garbage Collection Cycle (2 phases)
  • 1) Garbage Detection
  • 2) Garbage Reclamation
  • Root Set
  • Static variables
  • Local (stack-allocated) variables
  • General-purpose registers.
  • All objects reachable from the root set are
    consider live and cannot be reclaimed.
    Un-reachable objects can be freed.

9
STW Semi-Space
10
STW Semi-Space
  • Advantages
  • Inherently compacts data during copying.
  • Disadvantages
  • Requires a lot more heap memory!

11
STW Mark-Sweep
12
STW Mark-Sweep
  • Advantages
  • Simple implementation
  • Handles cyclical garbage
  • Disadvantages
  • Fragmentation of memory
  • Garbage collection time is proportional to heap
    size

13
STW Generational Copy
14
STW Generational Mark-Sweep
15
STW Generational
  • Advantage
  • Reduced garbage collection overhead
  • Disadvantage
  • More book keeping overhead to keep track of
    references from the mature space to the nursery
    (Write Barriers)

16
Garbage Collector Selection
  • There is no single garbage collector that will be
    optimal in all situations.
  • Current VMs garbage collectors are static
    entities that are included at VM compile time or
    selected via a user command line switch.
  • Lack of environmental awareness results in a
    non-optimal garbage collector choice.

17
Aspect Oriented Programming
  • AOP can be used to overcome the performance
    limitations of a static garbage collector.
  • Aspects allow monolithic program components to be
    non-intrusively upgraded and modified to achieve
    new functionality.
  • Aspects permit the gathering of data throughout
    a programs hierarchy.

18
AspectJ
  • Join Point - A well defined location within the
    primary code where a concern will crosscut the
    application.
  • Pointcut - A collection of join points that
    designates where advice code should be inserted
    in the program.
  • Advice - Code to execute before, after, or around
    a pointcut encounter.

19
Adaptive Garbage Collector
  • Adopts a best-fit approach to garbage
    collection by adjusting itself to better suit the
    run-time environment.
  • In their paper, Suman et al. showed how adaptive
    garbage collection can benefit the performance of
    Java applications.
  • Adaptive garbage collection can be used for other
    purposes besides performance.

20
Why Use AOP?
  1. Aspects minimize the required changes to the RVM
    source code though the use of inter-type
    declarations and the aspectual introduction.
  2. Aspects can crosscut the RVM hierarchy to gather
    related VM statistics.
  3. Aspects allow for non-intrusive plugging and
    unplugging of VM components to update
    functionality.
  4. Aspects modularize the adaptive garbage collector
    behavior so future upgrades require minimal
    effort.

21
Jikes Research Virtual Machine
22
Java Virtual Memory Toolkit
  • From version 2.2.0 of the Jikes RVM, the garbage
    collector is contained within the Java Memory
    Tookit
  • The core VM is isolated from any memory
    management responsibilities and allows different
    garbage collectors to be compared on a 11 basis.

23
Java Virtual Memory Toolkit
  • The garbage collector in the JMTk is composed
    from multiple highly reusable classes.
  • All garbage collectors are of the Stop the World
    variety.
  • The unique characteristics of a garbage collector
    is derived from its Plan and associated
    policies classes.

24
Aspectual Framework
  1. Extract all used garbage collector methods and
    re-target them with aspects.
  2. Introduce new garbage collection schemes into the
    singular JMTk garbage collection plan with
    aspects.
  3. Resolve all memory map conflicts between
    co-existing garbage collectors.
  4. Create a heuristic for garbage collector
    selection.

25
Aspectual Framework
26
Jikes RVM Virtual Memory Map
27
Universal Virtual Memory Map
  • The universal virtual memory map helps resolve
    resource conflicts between the JMTk garbage
    collectors.
  • Semi-Space
  • Generational Copy

28
Limitations/Overhead of AspectJ
  • AOP has an inherent overhead associated with
    pointcut matching and advice execution.
  • In the Jikes RVM, writeBarriers are needlessly
    called on non-generational garbage collectors
  • Final Variables not targetable.
  • Protected Access Types are not supported
  • Non Intuitive Pointcuts for abstract methods.

29
SPEC JVM 98 Benchmarks
  • Compress
  • Uses a modified Lempel-Ziv method (LZW) to
    compress data.
  • Jess
  • Java Expert Shell System that continuously
    applies a set of if-then statements, called
    rules, to a set of data, called the fact list.
  • Db
  • Performs multiple database functions on a memory
    resident database.
  • Javac
  • Java compiler from the JDK 1.0.2.

30
SPEC JVM 98 Benchmarks
  • Mpegaudio
  • Decompresses audio files that conform to the ISO
    MPEG Layer-3 audio specification.
  • Mtrt
  • A raytracer that works on a scene depicting a
    dinosaur, where two threads each renders the
    scene in the input file time-test model .
  • Jack
  • A Java parser generator that is based on the
    Purdue Compiler Construction Tool Set (PCCTS).

31
Computer/Experiment Setup
  • A computer with the following characteristics was
    used to produce the experimental results.
  • 2.0 Ghz Intel Xeon Processor
  • 1 GB DDR 266 system memory
  • RedHat 9.0 Linux OS (standard installation)
  • All JVM98 benchmarks were executed 5 times on a
    100 sized dataset for each heap size. The
    fastest and slowest times are discarded and the
    remaining 3 are averaged.

32
Jikes RVM Setup
  • Fast
  • Assertion checking in the RVM is turned o.
  • All necessary RVM classes are included in the
    boot image.
  • Adaptive
  • The adaptive optimizing compiler selects
    "hot-spots" during a programs execution via a
    statistical sampling model. As such, every run of
    the Jikes RVM with the adaptive compiler will
    produce slightly differing results.

33
JVM98 Benchmark Min Heap Sizes
  • The Generational Mark Sweep collector has the
    lowest memory heap requirements of all evaluated
    garbage collectors

34
JVM98 Standardized Heap Sizes
  • In order to ensure a fair comparison between all
    garbage collectors, the minimum heap size was
    standardized to be the largest of the minimum
    values for the four garbage collectors.

35
SPEC JVM98 Jess Results
36
Jess Garbage Collection Count
37
Jess Results
38
SPEC JVM98 Db Results
39
Db Garbage Collection Count
40
Db Garbage Collection Count
41
SPEC JVM98 Javac Results
42
Javac Garbage Collection Count
43
Javac Results
44
Summary
  • Described how to increase the performance of Java
    applications with the use of AOP.
  • Defined and created an AOP framework to
    facilitate an adaptive garbage collector and
    implemented it in the Jikes RVM.
  • Discovered that our AOP framework introduces a
    slight performance overhead but can increase the
    JVM98 benchmark performance on the Jikes RVM
    significantly.

45
Future Work
  • Our AOP framework does not currently support
    on-the-fly garbage collector switching.
    However, the framework can be upgraded to do so.
Write a Comment
User Comments (0)
About PowerShow.com