Presentation is loading. Please wait.

Presentation is loading. Please wait.

Iceberg: A Tool for Static Analysis of Java Critical Sections Michael D. Shah, Samuel Z. Guyer Tufts University Soap Workshop Session II, 10:50-11:10am,

Similar presentations


Presentation on theme: "Iceberg: A Tool for Static Analysis of Java Critical Sections Michael D. Shah, Samuel Z. Guyer Tufts University Soap Workshop Session II, 10:50-11:10am,"— Presentation transcript:

1 Iceberg: A Tool for Static Analysis of Java Critical Sections Michael D. Shah, Samuel Z. Guyer Tufts University Soap Workshop Session II, 10:50-11:10am, June 14, 2016

2 Categories of Concurrency Work Correctness o Race Conditions o Deadlock Performance o Scalability o Occasional problems

3 Categories of Concurrency Work Correctness o Race Conditions o Deadlock Performance o Scalability o Occasional problems

4 The Problem Real world coders may not always understand the performance of their code in critical sections.

5 Critical Section An area of code protected by a ‘lock’ o ad-hoc synchronization In Java, done with keyword ‘synchronized’ o We are focusing on finding methods that are synchronized

6 Critical Section An area of code protected by a ‘lock’ o ad-hoc synchronization In Java, done with keyword ‘synchronized’ o We are focusing on finding methods that are synchronized

7 What is in a Critical Section? High latency operations o I/O o Garbage Collection Amortized cost operations o Rehash, expand array-list Unexpected actions o Error handling or logging Over-synchronization o Irrelevant work

8 Our Soot based Tool: Iceberg Compile with Java compiler Transform Bytecode with Soot Build Call Graph Mark Critical Sections Gather Features of Critical Sections Output Summary and Graph

9 Code Metrics Collected on 24 Real World Programs Nested Methods Nested Loops Contains Allocations Large Line Count Branches Java Library Method

10 Sample Method

11 Synchronized Method

12 Visualization Aids Synchronized Method

13 Sample Method - Metrics # of methods in first level – 6 Total # of method calls – 11673 Total # of synchronized methods in first level – 3 Total # of synchronized method calls – 240 Total number of Java Library Calls – 11664 Number of allocations in first level – 0 Total number of allocations – 3030 Total number of lines of iR - 128265

14 Sample Method - Metrics # of methods in first level – 6 Total # of method calls – 11673 Total # of synchronized methods in first level – 3 Total # of synchronized method calls – 240 Total number of Java Library Calls – 11664 Number of allocations in first level – 0 Total number of allocations – 3030 Total number of lines of iR - 128265

15 Sample Method - Metrics # of methods in first level – 6 Total # of method calls – 11673 Total # of synchronized methods in first level – 3 Total # of synchronized method calls – 240 Total number of Java Library Calls – 11664 Number of allocations in first level – 0 Total number of allocations – 3030 Total number of lines of iR - 128265

16 Performance Pitfalls Over Synchronization o Too liberal use of ‘synchronized’ Large Critical Section o Lots of method calls Nested Critical Section o Many locks obtained

17 Are Developers Aware of Code Size? Our analysis is conservative, and static Does not handle reflection cases BUT, it appears call trees could possibly be very deep in worse case scenario o We compute maximum depth o (Other features like max children)

18 Results Critical sections can often be bigger than you think Libraries hide a lot of code o Including nested critical sections

19 Future Work – Static Analysis Integrate Static Analysis into IDE o Highlighting potential bad paths Collecting more code metrics

20 Future Work – Dynamic Analysis Dynamic analysis to measure actual time o Build actual call graph of program execution Latency variability analysis o Identify slow vs fast paths Concolic Testing o Force programs down “bad” paths Michael.Shah@tufts.eduMichael.Shah@tufts.edu michaeldshah.net @MichaelShah

21 Thank You! Questions and Feedback? Contact: o Michael.Shah@tufts.edu o michaeldshah.net o @MichaelShah

22 Why Care About Performance Mobile Servers Games Image Sources: http://www.forbes.com/sites/kellyclay/2013/08/19/amazon-com-goes-down-loses-66240-per-minute/ http://www.techcrok.com/ http://modloader-for-minecraft.en.softonic.com/


Download ppt "Iceberg: A Tool for Static Analysis of Java Critical Sections Michael D. Shah, Samuel Z. Guyer Tufts University Soap Workshop Session II, 10:50-11:10am,"

Similar presentations


Ads by Google