lu fang university of california irvine
play

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


  1. Lu Fang, University of California, Irvine Liang Dou, East China Normal University Harry Xu, University of California, Irvine 2015-07-09

  2.  Inefficient code regions [G. Jin et al. PLDI 2012]

  3.  Inefficient code regions [G. Jin et al. PLDI 2012]

  4.  Inefficient code regions [G. Jin et al. PLDI 2012]

  5.  Inefficient code regions [G. Jin et al. PLDI 2012]  Widely exist ◦ Firefox developers fix 50+/month over 10 years

  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.

  7.  Existing solutions ◦ Most are postmortem debugging techniques

  8.  Existing solutions ◦ Most are postmortem debugging techniques

  9.  Existing solutions ◦ Most are postmortem debugging techniques

  10.  Existing solutions ◦ Most are postmortem debugging techniques  Large workloads ◦ To manifest performance problems ◦ NO NOT available in testing environment, usually

  11.  Find and fix performance problems ◦ In the testing environment ◦ Even without large workloads

  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.

  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

  14.  A novel performance testing framework ◦ To detect memory related performance problems

  15.  A novel performance testing framework ◦ To detect memory related performance problems  General idea: amplify performance problems

  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 oms an and d co counte unter r ex examples amples

  17.  A novel performance testing framework ◦ To detect memory related performance problems  General idea: amplify performance problems

  18.  A novel performance testing framework ◦ To detect memory related performance problems  General idea: amplify performance problems

  19.  A novel performance testing framework ◦ To detect memory related performance problems  General idea: amplify performance problems

  20. e.g. g. to to dete tect ct memo me mory leaks, ks, o is not o not used used for a fo a l lon ong ti g time me  A novel performance testing framework ◦ To detect memory related performance problems  General idea: amplify performance problems o is used o used aga gain, n, so o o is not o not le leaki king ng

  21.  A novel performance testing framework ◦ To detect memory related performance problems  General idea: amplify performance problems

  22.  Virtual amplification ◦ Provide test oracles  ISL (Instrumentation Specification Language) ◦ Describe memory related performance problems  Mirror chain ◦ Record useful debugging information

  23.  Amplification (at object level) ◦ Add space penalties to suspicious objects ◦ Make the symptoms more obvious ◦ Deamplification

  24.  Amplification (at object level) ◦ Add space penalties to suspicious objects ◦ Make the symptoms more obvious ◦ Deamplification  Virtual ◦ Counter per object

  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

  26.  Describe performance problems manifested by memory inefficiencies ◦ such as memory leaks, etc.

  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

  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

  29. • TO TObject ect Tr Track acked ed Ob Objects ects • Conte ntext xt

  30. • TO TObject ect Tr Track acked ed Ob Objects ects • Conte ntext xt Hi Hist story ory • Hi Hist story ory In Info formation mation • Pa Parti titio tion

  31. • TO TObject ect Tr Track acked ed Ob Objects ects • Conte ntext xt Hi Hist story ory • Hi Hist story ory In Info formation mation • Pa Parti titio tion Sy Symp mptoms toms and nd • Event vent Counter unterexa examples mples

  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

  33. Sp Specify cify the e tra rack cked ed obje jects cts Context TrackingContext { Context : (1) Calling Context sequence = "*,*.main,*"; (2) Object Type TObject : Tracked Object type = "java.lang.Object"; Specification } TObject MyObj{ include = TrackingContext; Event on_rw(Object o, Field f, partition = P; Word w1, Word w2){ instance boolean useFlag = o.useFlag = true; false; //Instance Field deamplify(o); } } History UseHistory { Event on_reachedOnce(Object o){ type = "boolean"; UseHistory h = getHistory(o); size = 10;//User Parameter h.update(o.useFlag); } if(h.isFull() Partition P { && !h.contains(true)){ kind = all; amplify(o); history = UseHistory; } } }

  34. Record cord his istory tory information formation Context TrackingContext { History : Execution Windows sequence = "*,*.main,*"; Partition: (1) Heap Partitioning type = "java.lang.Object"; (2) The Binding History } TObject MyObj{ include = TrackingContext; Event on_rw(Object o, Field f, partition = P; Word w1, Word w2){ instance boolean useFlag = o.useFlag = true; false; //Instance Field deamplify(o); } } History UseHistory { Event on_reachedOnce(Object o){ type = "boolean"; UseHistory h = getHistory(o); size = 10;//User Parameter h.update(o.useFlag); } if(h.isFull() Partition P { && !h.contains(true)){ kind = all; amplify(o); history = UseHistory; } } }

  35. Define De fine the e action tions Context TrackingContext { Event: (1) Counterexamples sequence = "*,*.main,*"; (2) Symptoms type = "java.lang.Object"; } TObject MyObj{ include = TrackingContext; Event on_rw(Object o, Field f, partition = P; Word w1, Word w2){ instance boolean useFlag = o.useFlag = true; false; //Instance Field deamplify(o); } } History UseHistory { Event on_reachedOnce(Object o){ type = "boolean"; UseHistory h = getHistory(o); size = 10;//User Parameter h.update(o.useFlag); } if(h.isFull() Partition P { && !h.contains(true)){ kind = all; amplify(o); history = UseHistory; } } }

  36.  Very useful for debugging [G. Xu et al, PLDI 2011] ◦ Reveal both calling context and data structures

  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

  38. ◦ A mirror of reference path Wha hat t we we wa want nt Wha hat t we we ge get

  39. ◦ A mirror of reference path Wha hat t we we wa want nt Wha hat t we we ge get ◦ An algorithm to build the mirror chain  Details can be found in our paper

  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

  41. 60 VSOs caused by confirmed memory leaks Basic VSOs 50 40 30 20 VSO is large  The program is very like to have leaks 10 0 antlr bloat eclipse fop luindex lusearch pmd hsqldb jython xalan Programs with confirmed unknown leaks

  42. 60 VSOs caused by confirmed under-utilized containers Basic VSOs 50 40 30 20 VSO is large  The program is very likely to have UUCs 10 0 antlr bloat eclipse fop luindex lusearch pmd hsqldb jython xalan Programs with confirmed unknown UUCs

  43. 30 VSOs caused by confirmed over-populated containers Basic VSOs 25 20 15 VSO is large  The program is very like to have OPCs 10 5 0 antlr bloat eclipse fop luindex lusearch pmd xalan hsqldb jython Programs with confirmed unknown OPCs

Recommend


More recommend