Interpreting Java Program Runtimes

Slides:



Advertisements
Similar presentations
Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
Advertisements

Java Implementation Arthur Sale & Saeid Nooshabadi The background to a Large Grant ARC Application.
Programmability with Proof-Carrying Code George C. Necula University of California Berkeley Peter Lee Carnegie Mellon University.
Introduction to Java Programming
Memory Management 2010.
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
1 Java Grande Introduction  Grande Application: a GA is any application, scientific or industrial, that requires a large number of computing resources(CPUs,
C++ vs. Java: Similiarities & Differences Dr. Jeyakesavan Veerasamy Director of CS UTDesign program & CS Teaching Faculty University.
1 Software Testing and Quality Assurance Lecture 31 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
Introduction to Java.
Embedded Java Research Geoffrey Beers Peter Jantz December 18, 2001.
Chocolate Bar! luqili. Milestone 3 Speed 11% of final mark 7%: path quality and speed –Some cleverness required for full marks –Implement some A* techniques.
1 TOPIC 1 INTRODUCTION TO COMPUTER SCIENCE AND PROGRAMMING Topic 1 Introduction to Computer Science and Programming Notes adapted from Introduction to.
Instruction Set Architecture
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
COMP25212: Virtualization Learning Objectives: a)To describe aims of virtualization - in the context of similar aims in other software components b)To.
Lecture 10 : Introduction to Java Virtual Machine
1 Comp 104: Operating Systems Concepts Java Development and Run-Time Store Organisation.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
1 CSC204 – Programming I Lecture 2 Intro to OOP with Java.
Buffered dynamic run-time profiling of arbitrary data for Virtual Machines which employ interpreter and Just-In-Time (JIT) compiler Compiler workshop ’08.
1 Fast and Efficient Partial Code Reordering Xianglong Huang (UT Austin, Adverplex) Stephen M. Blackburn (Intel) David Grove (IBM) Kathryn McKinley (UT.
Chapter 4 Memory Management Virtual Memory.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
Virtual Machines, Interpretation Techniques, and Just-In-Time Compilers Kostis Sagonas
Dynamic Analysis and Visualizing of Data Structures in Java Programs Presented by Sokhom Pheng (Supervisor: Clark Verbrugge) McGill University February.
1 Chapter 1 Programming Languages Evolution of Programming Languages To run a Java program: Java instructions need to be translated into an intermediate.
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Lecture #20: Profiling NetBeans Profiler 6.0.
RealTimeSystems Lab Jong-Koo, Lim
Eliminating External Fragmentation in a Non-Moving Garbage Collector for Java Author: Fridtjof Siebert, CASES 2000 Michael Sallas Object-Oriented Languages.
(Not too) Real-Time JVM (Progress Report)
DecisionSoft Java in the real world DecisionSoft Stephen White 8 th February 2007.
Applications Active Web Documents Active Web Documents.
Object Oriented Programming in
Object Lifetime and Pointers
Computer Organization and Design Pointers, Arrays and Strings in C
Multitasking without Compromise: a Virtual Machine Evolution
Jonathan Walpole Computer Science Portland State University
Topic: Java Garbage Collection
Chapter 2 Memory and process management
Intro to ETEC Java.
Before You Begin Nahla Abuel-ola /WIT.
Interpreted languages Jakub Yaghob
A Closer Look at Instruction Set Architectures
Modified from Stanford CS276 slides Lecture 4: Index Construction
External Sorting Chapter 13
Storage Management.
CS 153: Concepts of Compiler Design November 28 Class Meeting
Introduction Enosis Learning.
Java Virtual Machine Complete subject details are available at:
The Simplest Heuristics May Be The Best in Java JIT Compilers
Introduction Enosis Learning.
The Operating System Memory Manager
Software Testing and Maintenance Modifying Code
CSc 453 Interpreters & Interpretation
ECE Dept., University of Toronto
LESSON 13 – INTRO TO ARRAYS
ColdFusion Performance Troubleshooting and Tuning
Adaptive Code Unloading for Resource-Constrained JVMs
Memory Allocation CS 217.
External Sorting Chapter 13
Closure Representations in Higher-Order Programming Languages
Parallel Analytic Systems
CLEANING UP UNUSED OBJECTS
Sub-Quadratic Sorting Algorithms
(Computer fundamental Lab)
CSE 373: Data Structures and Algorithms
External Sorting Chapter 13
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
CMSC 202 Constructors Version 9/10.
Presentation transcript:

Interpreting Java Program Runtimes Stuart Hansen UW - Parkside

The Problem: The Real Problem: The JVM influences program runtimes in complex and mysterious ways The Real Problem: It is VERY frustrating to obtain runtimes that you can’t explain

Algorithm Analysis One goal of algorithm analysis is to predict resources (e.g. time) that an implementation will require There are many confounding influences Speed of CPU - Implementation Language Load on the system - Compiler Size of physical memory Operating system

Algorithm Analysis con’t. We use the confounding influences as pedagogic tools CPU time vs. elapsed time Physical memory vs. virtual memory Compiler optimizations

Java VM Presents New Issues What are they? Can we control them? Can we use them at teaching aids?

Lack of Documentation Lots of material on Java performance with lots of practical advice None tells why my BubbleSort code doesn’t graph to be a parabola

Three Examples Calls to Arrays.sort Modified Mergesort Rehashing All experiments performed using Sun’s Java SDK 1.4.2 under Debian Linux

Arrays.sort( ) Compare runtimes of CS1 sorts to Arrays.sort()

Dynamic Class Loading Java loads a class only when it is first referenced Disk IO is slow Can force pre-loading using Class.forName()

Side Issue – Java Startup Simplest Java application public class Simple { public static void main (String [] args) { } } Loads 280 classes

Mergesort Requires an auxiliary array for merging Should only be as big as subarrays to be merged Too large of an array degrades performance to O(n2) Let students work with and improve bad code

Results

Finding the Parabola Limit the graph to the smaller array sizes

Heap Management Generational Garbage Collector Controlling Heap size Major and minor garbage collections Alternative is incremental garbage collection Controlling Heap size Grows as needed by default -Xms and –Xmx options

Incremental GC

Things to Note Still not perfectly smooth Incremental GC creates a performance hit of about 10%

Rehashing Suggested by Mike Clancy during panel discussion at SIGCSE 2002 Create a Hashtable of a fixed size Load with different amounts of data Explicitly invoke rehash()

Rehashing Results

Optimizations in Java Dynamic Compilation Dynamic Optimization Byte code to native code Dynamic Optimization E.g. Method inlining Both are hard to control

Rehashing with Large Initial Heap Lets more time be dedicated to rehashing

Remaining Issues Each data set is still analyzed on an ad hoc basis No consistent set of instructions to give to students to get meaningful runtimes No handle on Java 5

Conclusion Questions? Highly recommend experimentation in classes Need tenacity to explain the results Questions?