gated memory control for memory monitoring leak detection and garbage collection l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Gated Memory Control for Memory Monitoring, Leak Detection and Garbage Collection PowerPoint Presentation
Download Presentation
Gated Memory Control for Memory Monitoring, Leak Detection and Garbage Collection

Loading in 2 Seconds...

play fullscreen
1 / 23

Gated Memory Control for Memory Monitoring, Leak Detection and Garbage Collection - PowerPoint PPT Presentation


  • 123 Views
  • Uploaded on

Gated Memory Control for Memory Monitoring, Leak Detection and Garbage Collection. Chen Ding, Chengliang Zhang Xipeng Shen, Mitsunori Ogihara University of Rochester 6/12/2005. Motivation. Modern software is large and complex Dynamic memory allocation and reclamation are widely used

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Gated Memory Control for Memory Monitoring, Leak Detection and Garbage Collection' - navarro


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
gated memory control for memory monitoring leak detection and garbage collection

Gated Memory Control for Memory Monitoring, Leak Detection and Garbage Collection

Chen Ding, Chengliang Zhang

Xipeng Shen, Mitsunori Ogihara

University of Rochester

6/12/2005

MSP’05

motivation
Motivation
  • Modern software is large and complex
  • Dynamic memory allocation and reclamation are widely used
  • Problems
    • Double deletions
    • Dangling links
    • Memory leaks

MSP’05

motivation cont
Motivation (Cont.)
  • Decades of research has produced highly effective methods for managing dynamic objects
  • Existing methods usually work at the level of procedures and allocation sites
  • Recently, program phase analysis makes it possible to automatically identify high level phases which span thousands of lines of codes

MSP’05

question
Question
  • How much the high-level phase information can benefit the dynamic memory management?

MSP’05

phase
Phase
  • A phase is a unit of recurring behavior, and the boundaries of a phase can be uniquely marked in the program
  • Every phase instance corresponds to a section of the program execution
  • Phases reveal the high level structure of run-time program behavior

Phase instances of GCC with input cp-decl.i

MSP’05

gated memory control
Gated Memory Control

Memory usage monitoring

Object lifetime classification

Preventive garbage collection

MSP’05

outline
Outline
  • Motivation
  • Gated Memory Control
    • Memory usage monitoring
    • Object lifetime classification
      • Ranking memory usage
      • Detecting memory leaks
      • Directing object grouping
    • Preventive garbage collection
  • Related work
  • Summary

MSP’05

outline10
Outline
  • Motivation
  • Gated Memory Control
    • Memory usage monitoring
    • Object lifetime classification
      • Ranking memory usage
      • Detecting memory leaks
      • Directing object grouping
    • Preventive garbage collection
  • Related work
  • Summary

MSP’05

object lifetime classification
Object Lifetime Classification
  • Object lifetime: the number of phase instances between the first and the last use
  • Behavior of a dynamic memory object
    • Phase local: the lifetime <=1
    • Phase global: otherwise

MSP’05

allocation site classification
Allocation Site Classification
  • Allocation site: call sequence
    • main()-> parser()-> malloc()
  • Behavior of an allocation site
    • Phase local: all objects allocated at this site are phase local
    • Phase global: otherwise

MSP’05

ranking memory usage
Ranking Memory Usage
  • Rank allocation sites based on
    • Phase local
    • the size of the memory allocated
  • Report the number/size of each class of the memory objects

MSP’05

detecting memory leaks
Detecting Memory Leaks
  • A possible memory leak
    • An allocation site is phase local, but some of its objects are not freed at the end of the phase
  • May raise false alarms
  • Problem of profiling: missing memory leaks
    • Multiple training inputs to increase the coverage
  • Experiment results
    • GCC in SPEC2000, all train and ref inputs are considered
    • Some possible memory leaks

MSP’05

directing object grouping
Directing Object Grouping
  • Group the objects by their lifetime
  • Put into different virtual memory pages
  • Advantages
    • Save the physical memory usage
    • Reduce the energy consumption

MSP’05

outline16
Outline
  • Motivation
  • Gated Memory Control
    • Memory usage monitoring
    • Object lifetime classification
      • Ranking memory usage
      • Detecting memory leaks
      • Directing object grouping
    • Preventive garbage collection
  • Related work
  • Summary

MSP’05

preventive garbage collection
Preventive Garbage Collection
  • Preventive GC
    • Always call GC at the phase boundary
    • Do not call GC during a phase, unless reaching the hard upper bound of available memory
  • Reactive (conventional) GC
    • Run GC once the soft bound is reached, e.g. the previously collected free space is used up
  • No GC
    • No GC unless the hard bound is reached

MSP’05

comparison
Comparison

Balancing between the space consumption and the number of

GC calls

  • Not too many GCs called
  • Not too much memory consumed

Reactive

Often too eager

Preventive

Adapt to program’s need

NO GC

Too lazy

MSP’05

evaluations on xlisp
Evaluations on xlisp

xlisp in SPEC2000 with ref and train datasets as inputs

MSP’05

related work
Related Work
  • Phase detection
    • [Shen+ ASPLOS04] [Shen+ URCS TR848]
  • Object lifetime and memory leak detection
    • [Chilimbi&Hauswirth ASPLOS’04, Hirzel+ TOPLAS’02, Zorn&Seidl ASPLOS’98, Barrett&Zorn PLDI’93]
  • Using GC for improving locality
    • [Huang+ OOPSLA’04, Chilimbi&Larus ISMM’98, Wilson+ PLDI’91]
  • Explicit memory allocation
    • [Berger+ OOPSLA’02/PLDI’02, Wilson+ ISMM’95]

MSP’05

summary
Summary
  • Monitoring memory usage at the phase boundary shows the trend better than the traditional moving average method does
  • By analyzing the object lifetime, we have detected possible memory leaks in GCC
  • Preventive garbage collection improves the execution time of xlisp by up to 44% over the default reactive garbage collection

MSP’05

questions
Questions?

Thanks!

MSP’05

slide23

allocation site

object

MSP’05