Finding Class Loader Leaks in Java Applications Jevgeni Kabanov.

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

SSA and CPS CS153: Compilers Greg Morrisett. Monadic Form vs CFGs Consider CFG available exp. analysis: statement gen's kill's x:=v 1 p v 2 x:=v 1 p v.
A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Pallavi Joshi  Chang-Seo Park  Koushik Sen  Mayur Naik ‡  Par Lab, EECS, UC Berkeley‡
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2011 More Control Flow John Cavazos University.
1 Symbolic Execution for Model Checking and Testing Corina Păsăreanu (Kestrel) Joint work with Sarfraz Khurshid (MIT) and Willem Visser (RIACS)
Do you really get class loaders? Jevgeni Kabanov Founder & CTO of ZeroTurnaround.
Copyright © 2001 Qusay H. Mahmoud Case Study A Global Compute Engine Here we will discuss some implementation details: – Class Loaders – Compute Engine.
JREBEL FOR ECLIPSE ECLIPSE DAY CHINA PRESENTER ANTON PRODUCT MANAGER.
GRAPHS Lecture 18 CS2110 – Fall Graph Algorithms 2 Search –depth-first search –breadth-first search Shortest paths –Dijkstra's algorithm Minimum.
Graphs - II CS 2110, Spring Where did I leave that book?
Graph Searching CSE 373 Data Structures Lecture 20.
Visibility Graphs May Shmuel Wimer Bar-Ilan Univ., Eng. Faculty Technion, EE Faculty.
Advanced Compiler Design – Assignment 1 SSA Construction & Destruction Michael Fäs (Original Slides by Luca Della Toffola)
1 Finding Dominators in Flowgraphs Linear-Time Algorithm 1 and Experimental Study 2 Loukas Georgiadis 1 joint work with Robert E. Tarjan 2 joint work with.

DAST 2005 Tirgul 11 (and more) sample questions. DAST 2005 Q.Let G = (V,E) be an undirected, connected graph with an edge weight function w : E→R. Let.
CMPUT Compiler Design and Optimization1 CMPUT680 - Winter 2006 Topic G: Static Single- Assignment Form José Nelson Amaral
CS 201 Compiler Construction
1 CS 201 Compiler Construction Lecture 9 Static Single Assignment Form.
More Graph Algorithms Weiss ch Exercise: MST idea from yesterday Alternative minimum spanning tree algorithm idea Idea: Look at smallest edge not.
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
SE-2840 Dr. Mark L. Hornick1 Java Servlet-based web apps Servlet Architecture.
Enterprise Java v090401JavaEE EAR1 Java EE Enterprise Archive (EAR)
Abstract Data Types (ADTs) Data Structures The Java Collections API
JRun 4 & Macromedia MX Tommy Reilly JRun Engineer.
Dijkstra’s Algorithm. 2 Shortest-path Suppose we want to find the shortest path from node X to node Y It turns out that, in order to do this, we need.
SCAN: a Scalable, Adaptive, Secure and Network-aware Content Distribution Network Yan Chen CS Department Northwestern University.
Tu sca ny 1 Extending The Tuscany Java SCA Runtime 21 August 2006.
Dominators, control-dependence and SSA form. Organization Dominator relation of CFGs –postdominator relation Dominator tree Computing dominator relation.
Graph Indexing: A Frequent Structure- based Approach Alicia Cosenza November 26 th, 2007.
Second Line Intrusion Detection Using Personalization DISA Sponsored GWU-CS.
Building SSA Form, III 1COMP 512, Rice University This lecture presents the problems inherent in out- of-SSA translation and some ways to solve them. Copyright.
Jonathan Gallimore | Tomitribe Cluster your application with JCache and CDI.
Union-Find  Application in Kruskal’s Algorithm  Optimizing Union and Find Methods.
Dead Code Elimination This lecture presents the algorithm Dead from EaC2e, Chapter 10. That algorithm derives, in turn, from Rob Shillner’s unpublished.
Modern Programming Language. Web Container & Web Applications Web applications are server side applications The most essential requirement.
Control Flow Analysis Compiler Baojian Hua
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2011 Static Single Assignment John Cavazos.
Computer Science 313 – Advanced Programming Topics.
Managing deployment and activation of Web Applications in a distributed e-Infrastructure EGI Technical Forum September 2011 Lyon
This material is based upon work supported by the U.S. Department of Energy Office of Science under Cooperative Agreement DE-SC Michigan State.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
Dominators and CFGs Taken largely from University of Delaware Compiler Notes.
Best-first search is a search algorithm which explores a graph by expanding the most promising node chosen according to a specified rule.
1 A Grid-Based Middleware’s Support for Processing Distributed Data Streams Liang Chen Advisor: Gagan Agrawal Computer Science & Engineering.
Bootstrap Tutorial Overview Objective Learn how to use the bootstrap for configuring the system. Requirements Installed Version of.
Graphs. What is a graph? In simple words, A graph is a set of vertices and edges which connect them. A node (or vertex) is a discrete position in the.
Optimizing The Optimizer: Improving Data Flow Analysis in Soot Michael Batchelder 4 / 6 / 2005 A COMP-621 Class Project.
Database: JDBC Overview
Server Side Programming
Database JDBC Overview CS Programming Languages for Web Applications
Zhenbo XU, Jian ZHANG, Zhongxing XU
CS360 Windows Programming
Liang Chen Advisor: Gagan Agrawal Computer Science & Engineering
Rajkishore Barik Efficient Computation of May-Happen-in-Parallel Information for Concurrent Java Programs Rajkishore Barik
Week 8 Nicholas Baker.
Social Simulation Project
Factored Use-Def Chains and Static Single Assignment Forms
Distributed Hash Tables
CSC4005 – Distributed and Parallel Computing
Building SSA Harry Xu CS 142 (b) 04/22/2018.
Working with Libraries
Prim’s algorithm for minimum spanning trees
CSE P 501 – Compilers SSA Hal Perkins Autumn /31/2019

M S COLLEGE ART’S, COMM., SCI. & BMS
Modeling the Spread of a Virus in a Modern Environment

Plug-In Architecture Pattern
Presentation transcript:

Finding Class Loader Leaks in Java Applications Jevgeni Kabanov

Based on Work in progress on class loader leak detection tool “Computing Dominators and Dominance Frontiers” by P. Briggs, T. Harvey “A Fast Algorithm for Finding Dominators in a Flowgraph” by T. Lengauer and R. Tarjan “A Simple, Fast Dominance Algorithm” by Cooper et al

Class loader API public abstract class ClassLoader { public Class loadClass(String name); protected Class defineClass(byte[] b); public URL getResource(String name); public Enumeration getResources(String name); public ClassLoader getParent() }

Class loading public class A { public void doSmth() { B b = new B(); b.doSmthElse(); } Causes a call to A.class.getClassLoader().loadClass(“B”);

Java EE Delegation ContainerApp1.earWAR1WAR2App2.earWAR3App3.earWAR4

Reloading an Object MyObject MyObject.clas s OldClassLoade r NewClassLoad er MyObject.clas s MyObject Recreate the object

Leaking ClassLoaders Class1.class ClassLoader Class2.class Class3.class Static Fields

Leaking ClassLoaders Leak Leak.class ExampleFactory$1 Example.class

Web Deployment Classes Libraries OldClassLoader NewClassLoader Sevlet New Classes New Libraries Sevlet Session init() App State Serialize/deserialize

Leak detection How are leaked class loaders different?

Dominators What are dominators useful for? –SSA –CPS Naïve algorithm O(N^2) Fixpoint algorithm O(N^2) Lengauer-Tarjan O(E logN)

FIXPOINT

Lengauer-Tarjan

1.Construct the DFS tree and give each node a depth-first index O(E) 1.Compute semidominators using TABA O(E) 2.Compute the dominators from the semidominators O(E) 1.Find minimum along the path = O(log N)