44
Dynamic Shape and Data Structure Analysis in Java Presented by Sokhom Pheng (Supervised by Clark Verbrugge) McGill University October 17 th 2005

Dynamic Shape and Data Structure Analysis in Java Presented by Sokhom Pheng (Supervised by Clark Verbrugge) McGill University October 17 th 2005

  • View
    217

  • Download
    1

Embed Size (px)

Citation preview

Dynamic Shape and Data Structure Analysis in JavaPresented by Sokhom Pheng(Supervised by Clark Verbrugge)

McGill UniversityOctober 17th 2005

October 17th 2005Dynamic Shape and Data Structure Analysis in Java2

Outline

Introduction & Contribution Design Challenges Experimental Results Future work & Conclusion

October 17th 2005Dynamic Shape and Data Structure Analysis in Java3

Outline

Introduction & Contribution Design Challenges Experimental Results Future work & Conclusion

October 17th 2005Dynamic Shape and Data Structure Analysis in Java4

Introduction

Two approachesStatic analysis

• Conservative• Limited to simple situations

Dynamic analysis• More accurate• More expensive

Have you ever wondered how data structures were constructed in your programs?

October 17th 2005Dynamic Shape and Data Structure Analysis in Java5

Contribution

Framework for data structure visualizationProgram understandingSet limits on static approaches

Provide two techniques for visualization

Provide dynamic representation of garbage data

October 17th 2005Dynamic Shape and Data Structure Analysis in Java6

Outline

Introduction & Contribution Design Challenges Experimental Results Future work & Conclusion

October 17th 2005Dynamic Shape and Data Structure Analysis in Java7

Design Overview

October 17th 2005Dynamic Shape and Data Structure Analysis in Java8

*J Shape Analyzer

Entry point 1: DAGEntry point 3: TreeEntry point 4: DAG

Entry point 1: DAGEntry point 3: TreeEntry point 4: DAG

Entry point 1: DAGEntry point 3: TreeEntry point 4: Tree

October 17th 2005Dynamic Shape and Data Structure Analysis in Java9

More Analysis Info

GC infoMight be useful for GC optimizationIf visualized, can see drag effect

AgingUseful for general program

understandingUseful for teaching

October 17th 2005Dynamic Shape and Data Structure Analysis in Java10

GC Info (splay tree)

application

library

October 17th 2005Dynamic Shape and Data Structure Analysis in Java11

GC Info (cont’d)

application

library

October 17th 2005Dynamic Shape and Data Structure Analysis in Java12

GC Info (cont’d)

October 17th 2005Dynamic Shape and Data Structure Analysis in Java13

Aging (splay tree)

application

library

tree

DAG

cycle

October 17th 2005Dynamic Shape and Data Structure Analysis in Java14

Outline

Introduction & Contribution Design Challenges Experimental Results Future work & Conclusion

October 17th 2005Dynamic Shape and Data Structure Analysis in Java15

Challenge 1: Animation Issue

This is what we want:

October 17th 2005Dynamic Shape and Data Structure Analysis in Java16

Animation Issue (cont’d)

This is what we have:

October 17th 2005Dynamic Shape and Data Structure Analysis in Java17

Tools Used

Tom Sawyer & yWorks yFilesDid not work properly as incremental

Graphviz NeatoPin down object causes problems

Graphviz DotTool we useNicest and easiest to use

October 17th 2005Dynamic Shape and Data Structure Analysis in Java18

Tom Sawyer & yWorks yFiles

October 17th 2005Dynamic Shape and Data Structure Analysis in Java19

Tools Used

Tom Sawyer & yWorks yFilesDid not work properly as incremental

Graphviz NeatoPin down object causes problems

Graphviz DotTool we useNicest and easiest to use

October 17th 2005Dynamic Shape and Data Structure Analysis in Java20

Graphviz Neato

October 17th 2005Dynamic Shape and Data Structure Analysis in Java21

Tools Used

Tom Sawyer & yWorks yFilesDid not work properly as incremental

Graphviz NeatoPin down object causes problems

Graphviz DotTool we useNicest and easiest to use

October 17th 2005Dynamic Shape and Data Structure Analysis in Java22

Challenge 2: Data Size

Visualization limitationToo many objects to draw

• BiSort: > 120,000 objects

Too many snapshots generated• Jess: > 48,000,000 snapshots

Computational costAnalysis

October 17th 2005Dynamic Shape and Data Structure Analysis in Java23

Data Size Potential Solutions

Problem with number of snapshots and costAnalyze data structure after a certain

number of modifications instead Problem with number of objects

Numerical summary

October 17th 2005Dynamic Shape and Data Structure Analysis in Java24

Outline

Introduction & Contribution Design Challenges Experimental Results Future work & Conclusion

October 17th 2005Dynamic Shape and Data Structure Analysis in Java25

Benchmarks

TinySplay tree, red-black tree

SmallJOlden suite

LargeSPECjvm98 suite

October 17th 2005Dynamic Shape and Data Structure Analysis in Java26

JOlden - BiSort

October 17th 2005Dynamic Shape and Data Structure Analysis in Java27

BiSort (cont’d)

October 17th 2005Dynamic Shape and Data Structure Analysis in Java28

BiSort GC Info

October 17th 2005Dynamic Shape and Data Structure Analysis in Java29

SPECjvm98 - Jess

October 17th 2005Dynamic Shape and Data Structure Analysis in Java30

Jess (cont’d)

October 17th 2005Dynamic Shape and Data Structure Analysis in Java31

Jess GC info

October 17th 2005Dynamic Shape and Data Structure Analysis in Java32

Outline

Introduction & Contribution Design Challenges Experimental Results Future work & Conclusion

October 17th 2005Dynamic Shape and Data Structure Analysis in Java33

Future Work

Map to static code location Visual improvement

Improve animation qualityCollapsing nodes to look at bigger

graphs More analyses, i.e. summary graphs

October 17th 2005Dynamic Shape and Data Structure Analysis in Java34

Related Work

Shape AnalysisWith Annotation

• Hummel et al.: program annotation• Fradet et Le Métayer: language annotation

Without annotation• Ghiya and Hendren: tree/DAG/cycle• Wilhelm et al.: shape graph• Navarro et al.: reference-shape graph

October 17th 2005Dynamic Shape and Data Structure Analysis in Java35

Related Work (cont’d)

Dynamic AnalysisOnline

• MIT Program Analysis Group: The Daikon invariant detector

• The Dynamo Project (Indiana University)

Offline• Dufour: *J, a tool for dynamic analysis of

Java programs

October 17th 2005Dynamic Shape and Data Structure Analysis in Java36

Conclusion

Design Challenges

Visualization & toolsAmount of data

Experimental ResultsJOlden SPECjvm98

October 17th 2005Dynamic Shape and Data Structure Analysis in Java37

References

1. J. Bogda and A. Singh. Can Shape Analysis work at run-time? In Proceedings of the 1st Java Virtual Machine Research and Technology Symposium, April 23-24, 2001.

2. B. Dufour, K. Driesen, L. Hendren, and C. Verbrugge. Dynamic metrics for java. OOPSLA ’03, pages 149-168.

3. P. Fradet and D. L. Métayer. Shape types. POPL ’97.

4. R. Ghiya and L. Hendren. Is it a tree, a dag, or a cyclic graph? A shape analysis for heap-directed pointers in c. POPL ’96.

5. B. Hackett and R. Rugina. Region-based shape analysis with tracked locations. POPL ’05.

6. A. Navarro, F. Corbera, R. Asenjo, A. Tineo, O. Plata, and E. Zapata. A new dependence test based on shape analysis for pointer-based codes. LCPC ’04

7. R. Wilhelm, S. Sagiv, and T. W. Reps. Shape analysis. In Computational Complexity, pages 1-17, 2000.

October 17th 2005Dynamic Shape and Data Structure Analysis in Java38

Questions?

October 17th 2005Dynamic Shape and Data Structure Analysis in Java39

SPECjvm98 - MpegAudio

October 17th 2005Dynamic Shape and Data Structure Analysis in Java40

MpegAudio (cont’d)

October 17th 2005Dynamic Shape and Data Structure Analysis in Java41

MpegAudio (cont’d)

October 17th 2005Dynamic Shape and Data Structure Analysis in Java42

MpegAudio (cont’d)

October 17th 2005Dynamic Shape and Data Structure Analysis in Java43

MpegAudio GC Info

October 17th 2005Dynamic Shape and Data Structure Analysis in Java44

MpegAudio GC Info (cont’d)