Lu Fang, University of California, Irvine Liang Dou, East China - - PowerPoint PPT Presentation

lu fang university of california irvine
SMART_READER_LITE
LIVE PREVIEW

Lu Fang, University of California, Irvine Liang Dou, East China - - PowerPoint PPT Presentation

Lu Fang, University of California, Irvine Liang Dou, East China Normal University Harry Xu, University of California, Irvine 2015-07-09 Inefficient code regions [G. Jin et al. PLDI 2012] Inefficient code regions [G. Jin et al. PLDI


slide-1
SLIDE 1

Lu Fang, University of California, Irvine Liang Dou, East China Normal University Harry Xu, University of California, Irvine

2015-07-09

slide-2
SLIDE 2

 Inefficient code regions [G. Jin et al. PLDI

2012]

slide-3
SLIDE 3

 Inefficient code regions [G. Jin et al. PLDI

2012]

slide-4
SLIDE 4

 Inefficient code regions [G. Jin et al. PLDI

2012]

slide-5
SLIDE 5

 Inefficient code regions [G. Jin et al. PLDI

2012]

 Widely exist

  • Firefox developers fix 50+/month over 10 years
slide-6
SLIDE 6

 Inefficient code regions [G. Jin et al. PLDI

2012]

 Widely exist

  • Firefox developers fix 50+/month over 10 years

 Consequences

  • Financial loss, scalability reduction, etc.
slide-7
SLIDE 7

 Existing solutions

  • Most are postmortem debugging techniques
slide-8
SLIDE 8

 Existing solutions

  • Most are postmortem debugging techniques
slide-9
SLIDE 9

 Existing solutions

  • Most are postmortem debugging techniques
slide-10
SLIDE 10

 Existing solutions

  • Most are postmortem debugging techniques

 Large workloads

  • To manifest performance problems
  • NO

NOT available in testing environment, usually

slide-11
SLIDE 11

 Find and fix performance problems

  • In the testing environment
  • Even without large workloads
slide-12
SLIDE 12

 Find and fix performance problems

  • In the testing environment
  • Even without large workloads

 Focus on me

memo mory ry rel related ated performance problems

  • Such as memory leaks, inefficiently used containers,

etc.

slide-13
SLIDE 13

 Find and fix performance problems

  • In the testing environment
  • Even without large workloads

 Focus on me

memo mory ry rel related ated performance problems

  • Such as memory leaks, inefficiently used containers,

etc.

  • Also many

y red edundant ndant co compu puta tations tions

 Such as unnecessary function calls

slide-14
SLIDE 14

 A novel performance testing framework

  • To detect memory related performance problems
slide-15
SLIDE 15

 A novel performance testing framework

  • To detect memory related performance problems

 General idea: amplify performance problems

slide-16
SLIDE 16

 A novel performance testing framework

  • To detect memory related performance problems

 General idea: amplify performance problems

De Desc scribe the ribe the sympt symptoms

  • ms an

and d co counte unter r ex examples amples

slide-17
SLIDE 17

 A novel performance testing framework

  • To detect memory related performance problems

 General idea: amplify performance problems

slide-18
SLIDE 18

 A novel performance testing framework

  • To detect memory related performance problems

 General idea: amplify performance problems

slide-19
SLIDE 19

 A novel performance testing framework

  • To detect memory related performance problems

 General idea: amplify performance problems

slide-20
SLIDE 20

 A novel performance testing framework

  • To detect memory related performance problems

 General idea: amplify performance problems

  • is used

used aga gain, n, so

  • is not

not le leaki king ng e.g.

  • g. to

to dete tect ct me memo mory leaks, ks,

  • is not

not used used fo for a a l lon

  • ng ti

g time me

slide-21
SLIDE 21

 A novel performance testing framework

  • To detect memory related performance problems

 General idea: amplify performance problems

slide-22
SLIDE 22

 Virtual amplification

  • Provide test oracles

 ISL (Instrumentation Specification Language)

  • Describe memory related performance problems

 Mirror chain

  • Record useful debugging information
slide-23
SLIDE 23

 Amplification (at object level)

  • Add space penalties to suspicious objects
  • Make the symptoms more obvious
  • Deamplification
slide-24
SLIDE 24

 Amplification (at object level)

  • Add space penalties to suspicious objects
  • Make the symptoms more obvious
  • Deamplification

 Virtual

  • Counter per object
slide-25
SLIDE 25

 Amplification (at object level)

  • Add space penalties to suspicious objects
  • Make the symptoms more obvious
  • Deamplification

 Virtual

  • Counter per object

 Virtual Space Overhead (VSO)

  • (P+S)/S

 P is the sum of counters of all the tracked objects  S is the size of the live heap

  • Test oracle  indicator of performance problems
slide-26
SLIDE 26

 Describe performance problems manifested

by memory inefficiencies

  • such as memory leaks, etc.
slide-27
SLIDE 27

 Describe performance problems manifested

by memory inefficiencies

  • such as memory leaks, etc.

 A simple, event-based language

  • Describe symptoms/counterexamples
  • Specify the corresponding actions
slide-28
SLIDE 28

 Describe performance problems manifested

by memory inefficiencies

  • such as memory leaks, etc.

 A simple, event-based language

  • Describe symptoms/counterexamples
  • Specify the corresponding actions

 An ISL program consists of:

  • TObject
  • Context
  • History
  • Partition
  • Event
slide-29
SLIDE 29

Tr Track acked ed Ob Objects ects

  • TO

TObject ect

  • Conte

ntext xt

slide-30
SLIDE 30

Tr Track acked ed Ob Objects ects

  • TO

TObject ect

  • Conte

ntext xt Hi Hist story

  • ry

In Info formation mation

  • Hi

Hist story

  • ry
  • Pa

Parti titio tion

slide-31
SLIDE 31

Tr Track acked ed Ob Objects ects

  • TO

TObject ect

  • Conte

ntext xt Hi Hist story

  • ry

In Info formation mation

  • Hi

Hist story

  • ry
  • Pa

Parti titio tion Sy Symp mptoms toms and nd Counter unterexa examples mples

  • Event

vent

slide-32
SLIDE 32

 Memory leaks in Java programs

  • Use

seles ess objects cannot be reclaimed because of unnece necess ssary ary references

 Memory leak symptoms in Java programs

  • Leaking objects are neither read nor written any

more (st stale)

 The counterexamples of memory leaks

  • The object is accessed again
slide-33
SLIDE 33

Context TrackingContext { sequence = "*,*.main,*"; type = "java.lang.Object"; } TObject MyObj{ include = TrackingContext; partition = P; instance boolean useFlag = false; //Instance Field } History UseHistory { type = "boolean"; size = 10;//User Parameter } Partition P { kind = all; history = UseHistory; } Event on_rw(Object o, Field f, Word w1, Word w2){

  • .useFlag = true;

deamplify(o); } Event on_reachedOnce(Object o){ UseHistory h = getHistory(o); h.update(o.useFlag); if(h.isFull() && !h.contains(true)){ amplify(o); } }

Sp Specify cify the e tra rack cked ed obje jects cts

Context : (1) Calling Context (2) Object Type TObject : Tracked Object Specification

slide-34
SLIDE 34

Context TrackingContext { sequence = "*,*.main,*"; type = "java.lang.Object"; } TObject MyObj{ include = TrackingContext; partition = P; instance boolean useFlag = false; //Instance Field } History UseHistory { type = "boolean"; size = 10;//User Parameter } Partition P { kind = all; history = UseHistory; } Event on_rw(Object o, Field f, Word w1, Word w2){

  • .useFlag = true;

deamplify(o); } Event on_reachedOnce(Object o){ UseHistory h = getHistory(o); h.update(o.useFlag); if(h.isFull() && !h.contains(true)){ amplify(o); } }

Record cord his istory tory information formation

History : Execution Windows Partition: (1) Heap Partitioning (2) The Binding History

slide-35
SLIDE 35

Context TrackingContext { sequence = "*,*.main,*"; type = "java.lang.Object"; } TObject MyObj{ include = TrackingContext; partition = P; instance boolean useFlag = false; //Instance Field } History UseHistory { type = "boolean"; size = 10;//User Parameter } Partition P { kind = all; history = UseHistory; } Event on_rw(Object o, Field f, Word w1, Word w2){

  • .useFlag = true;

deamplify(o); } Event on_reachedOnce(Object o){ UseHistory h = getHistory(o); h.update(o.useFlag); if(h.isFull() && !h.contains(true)){ amplify(o); } }

De Define fine the e action tions

Event: (1) Counterexamples (2) Symptoms

slide-36
SLIDE 36

 Very useful for debugging [G. Xu et al, PLDI

2011]

  • Reveal both calling context and data structures
slide-37
SLIDE 37

 Very useful for debugging [G. Xu et al, PLDI

2011]

  • Reveal both calling context and data structures

 Difficult to obtain

 Backward information of object graph is not available  In practice, GC implementations use BFS

slide-38
SLIDE 38
  • A mirror of reference path

Wha hat t we we wa want nt Wha hat t we we ge get

slide-39
SLIDE 39
  • A mirror of reference path
  • An algorithm to build the mirror chain

 Details can be found in our paper

Wha hat t we we wa want nt Wha hat t we we ge get

slide-40
SLIDE 40

 We have implemented 3 amplifiers

  • Memory leak amplifier
  • Under-utilized container (UUC) amplifier
  • Over-populated container (OPC) amplifier

 Benchmarks

  • DaCapo benchmark suite [S. Balckburn, et al.

OOPSLA 2006]

 Totally we have found 11 performance

problems

  • 8 unknown problems
  • 3 known problems
slide-41
SLIDE 41

Programs with confirmed unknown leaks

10 20 30 40 50 60 antlr bloat eclipse fop luindex lusearch pmd hsqldb jython xalan VSOs caused by confirmed memory leaks Basic VSOs

VSO is large  The program is very like to have leaks

slide-42
SLIDE 42

10 20 30 40 50 60 antlr bloat eclipse fop luindex lusearch pmd hsqldb jython xalan VSOs caused by confirmed under-utilized containers Basic VSOs

Programs with confirmed unknown UUCs VSO is large  The program is very likely to have UUCs

slide-43
SLIDE 43

5 10 15 20 25 30 antlr bloat eclipse fop luindex lusearch pmd xalan hsqldb jython VSOs caused by confirmed over-populated containers Basic VSOs

Programs with confirmed unknown OPCs VSO is large  The program is very like to have OPCs

slide-44
SLIDE 44

Benchma nchmark rk Space Space Reducti uction

  • n

Time me Reduct ductio ion xalan-leak 25.4% 14.6% jython-leak 24.3% 7.4% hsqldb-leak 15.6% 3.1% xalan-UUC 5.4% 34.1% jython-UUC 19.1% 1.1% hsqldb-UUC 17.4% 0.7% hsqldb-OPC 14.9% 2.9%

slide-45
SLIDE 45

 Time overheads

  • Memory leak amplifier: 2.39x
  • Under-utilized container: 2.74x
  • Over-populated container: 2.73x

 Space overheads

  • Memory leak amplifier: 1.23x
  • Under-utilized container: 1.23x
  • Over-populated container: 1.25x
slide-46
SLIDE 46

 Propose a framework for performance testing  Develop compiler and runtime system

support

 Successfully amplify three different types of

performance problems

  • Help developers find and fix performance problems

even in the testing environment

slide-47
SLIDE 47

Thanks! Q&A