Java Memory Leaks. Detecting Memory leaks across. Albert Mavashev, CTO Nastel Technologies, Inc.

Similar documents
Application Performance in the Cloud

Tuning WebSphere Application Server ND 7.0. Royal Cyber Inc.

Tool - 1: Health Center

<Insert Picture Here> Java Application Diagnostic Expert

Insight into Performance Testing J2EE Applications Sep 2008

Practical Performance Understanding the Performance of Your Application

Enterprise Manager Performance Tips

Java Monitoring. Stuff You Can Get For Free (And Stuff You Can t) Paul Jasek Sales Engineer

Monitoring and Diagnosing Production Applications Using Oracle Application Diagnostics for Java. An Oracle White Paper December 2007

THE BUSY DEVELOPER'S GUIDE TO JVM TROUBLESHOOTING

Web Performance, Inc. Testing Services Sample Performance Analysis

PTC System Monitor Solution Training

Tomcat Tuning. Mark Thomas April 2009

IBM WebSphere Server Administration

Performance Optimization For Operational Risk Management Application On Azure Platform

Cognos8 Deployment Best Practices for Performance/Scalability. Barnaby Cole Practice Lead, Technical Services

Enterprise Manager 12c for Middleware

Zing Vision. Answering your toughest production Java performance questions

CHAPTER 1 - JAVA EE OVERVIEW FOR ADMINISTRATORS

RESULTS OF OUR JAVA PERFORMANCE SURVEY November 2014

Problem Detection and Automatic Recovery of Business Applications

Effective Java Programming. measurement as the basis

Monitoring Best Practices for COMMERCE

Product Review: James F. Koopmann Pine Horse, Inc. Quest Software s Foglight Performance Analysis for Oracle

Transaction Performance Maximizer InterMax

HeapStats: Your Dependable Helper for Java Applications, from Development to Operation

Oracle WebLogic Thread Pool Tuning

Case Study: Load Testing and Tuning to Improve SharePoint Website Performance

White Paper. How to Achieve Best-in-Class Performance Monitoring for Distributed Java Applications

Performance Monitoring API for Java Enterprise Applications

Enabling ITIL Best Practices Through Oracle Enterprise Manager, Session # Ana Mccollum Enterprise Management, Product Management

B M C S O F T W A R E, I N C. BASIC BEST PRACTICES. Ross Cochran Principal SW Consultant

Oracle WebLogic Server 11g Administration

An Oracle White Paper September Advanced Java Diagnostics and Monitoring Without Performance Overhead

Basic TCP/IP networking knowledge of client/server concepts Basic Linux commands and desktop navigation (if don't know we will cover it )

Validating Java for Safety-Critical Applications

SAM Server Utility User s Guide

TECH TIPS 4 STEPS TO FORECAST AND PLAN YOUR NETWORK CAPACITY NEEDS

WEBAPP PATTERN FOR APACHE TOMCAT - USER GUIDE

How To Improve Performance On An Asa 9.4 Web Application Server (For Advanced Users)

What s Cool in the SAP JVM (CON3243)

Oracle Corporation Proprietary and Confidential

Monitoring applications in multitier environment. Uroš Majcen A New View on Application Management.

Performance Testing of Java Enterprise Systems

Angelika Langer The Art of Garbage Collection Tuning

The safer, easier way to help you pass any IT exams. Exam : C_HANASUP_1. SAP Certified Support Associate - SAP HANA 1.0.

An Oracle White Paper July Oracle Primavera Contract Management, Business Intelligence Publisher Edition-Sizing Guide

ELIXIR LOAD BALANCER 2

ColdFusion 8. Performance Tuning, Multi-Instance Management and Clustering. Sven Ramuschkat MAX 2008 Milan

Monitoring HP OO 10. Overview. Available Tools. HP OO Community Guides

MONITORING CF WHAT ARE MY OPTIONS AND WHY SHOULD I

Informatica Master Data Management Multi Domain Hub API: Performance and Scalability Diagnostics Checklist

Using jvmstat and visualgc to Solve Memory Management Problems

NetBeans Profiler is an

Java VM monitoring and the Health Center API. William Smith

WebSphere Architect (Performance and Monitoring) 2011 IBM Corporation

vrops Microsoft SQL Server MANAGEMENT PACK User Guide

JVM Performance Study Comparing Oracle HotSpot and Azul Zing Using Apache Cassandra

White Paper. The Ten Features Your Web Application Monitoring Software Must Have. Executive Summary

Applications Manager Best Practices document

Java Troubleshooting and Performance

Course Description. Course Audience. Course Outline. Course Page - Page 1 of 5

Agility Database Scalability Testing

Contents Introduction... 5 Deployment Considerations... 9 Deployment Architectures... 11

Delivering Quality in Software Performance and Scalability Testing

Monitoring Microsoft Exchange to Improve Performance and Availability

WebSphere Server Administration Course

Splunk for VMware Virtualization. Marco Bizzantino Vmug - 05/10/2011

Agile Performance Testing

Troubleshooting PHP Issues with Zend Server Code Tracing

Mobile Performance Management Tools Prasanna Gawade, Infosys April 2014

An Oracle White Paper September, Enterprise Manager 12c Cloud Control: Monitoring and Managing Oracle Coherence for High Performance

Extreme Performance with Java

Liferay Performance Tuning

Instrumentation Software Profiling

HP OO 10.X - SiteScope Monitoring Templates

Using Tomcat with CA Clarity PPM

A Practical Method to Diagnose Memory Leaks in Java Application Alan Yu

Debugging A MotoHawk Application using the Application Monitor

TECHNOLOGY WHITE PAPER. Application Performance Management. Introduction to Adaptive Instrumentation with VERITAS Indepth for J2EE

Monitoring Best Practices for

Global Headquarters: 5 Speen Street Framingham, MA USA P F

Oracle Weblogic. Setup, Configuration, Tuning, and Considerations. Presented by: Michael Hogan Sr. Technical Consultant at Enkitec

Table of Contents INTRODUCTION Prerequisites... 3 Audience... 3 Report Metrics... 3

SQL Server Whitepaper. Top 5 SQL Server. Cluster Setup Mistakes. By Kendra Little Brent Ozar Unlimited

11.1 inspectit inspectit

2013 OTM SIG CONFERENCE Performance Tuning/Monitoring


Monitoring Best Practices for

MID-TIER DEPLOYMENT KB

Troubleshoot the JVM like never before. JVM Troubleshooting Guide. Pierre-Hugues Charbonneau Ilias Tsagklis

Aplicações empresariais de elevada performance com Oracle WebLogic e Coherence. Alexandre Vieira Middleware Solutions Team Leader

Network Monitoring with Xian Network Manager

Monitoring Agent for Microsoft.NET Version Reference IBM

KillTest. 半 年 免 费 更 新 服 务

Operating Systems and Networks

Network Management and Monitoring Software

Why Alerts Suck and Monitoring Solutions need to become Smarter

WEBLOGIC ADMINISTRATION

Transcription:

Java Memory Leaks Detecting Memory leaks across multiple VMs Albert Mavashev, CTO Nastel Technologies, Inc. amavashev@nastel.com

2 Memory Perspectives OS Memory Perspective VM Memory Perspective Java Heap GC, Heap Used %, Max Heap Memory Used, Threads, Handles OS Memory Footprint May expand independently of JVM heap VM Memory footprint Subject to GC Activity Expansion in Heap will cause expansion in OS foot print Expansion in OS footprint does not always mean expansion in heap

Example: Max heap allocated upfront OS Memory Perspective VM Memory Perspective 90% Heap Free 10% Heap Used OS Memory Footprint Constant no growth VM Memory footprint Heap Used, Heap Free are the only fluctuating parameters Memory Used, Threads, Handles

Example: Floating Heap OS Memory Perspective Heap Allocated VM Memory Perspective 45% 45% Heap Available for expansion 10% Heap Used OS Memory Footprint Expand or contract with heap usage VM Memory footprint Heap Used, Heap Free are the only fluctuating parameters Memory Used, Threads, Handles

Resource Leaks: Typical symptoms OutOfMemory exceptions Not always a leak: could be due to heap sizing issues Threads reporting exceptions are not always what is leaking memory Increasing GC activity Watch GC frequency, GC duration Obvious: Increasing heap usage Not so obvious Thread leaks, handle leaks, JDBC statement leaks ClassLoader leaks

Typical causes of Java leaks Programming errors, bugs (within VM) Unchecked array, list, hash map growth Not closing JDBC Prepared Statements Not closing Sockets, File handles Thread leaks, handle leaks Class loader leaks Outside of VM perimeter Resources allocated outside JVM Handle, threads, semaphores, memory

Class Loader leaks Typically caused by application re deployment Old class loader is discarded Holds on to Class definitions, static fields New Class Loader instantiated and new set of classes are re loaded Old Class Loader New Class Loader UserObject.class Leak UserObject.class Object instances Object instances

Typical Remedies Find the root cause and fix the code Often difficult to troubleshoot Hard to trace leaks within third party libraries Restart JVM(s) to reset resource usage Failover to the secondary instance Application server clustering/failover Viable only if leaks are non aggressive (slow growing) Early detection/warning of possible leaks Time buffer to decide on proper remedy Allows time for diagnostics with minimal downtime Avoid crisis situations, performance degradation associated with resource exhaustion

Detecting Resource Leaks across multiple VMs Determine detection model for a single VM Apply the model across multiple VMs (by induction) Monitor OS resource perimeter Memory foot print, handles, threads Monitor VM resource perimeter Heap allocated, max, used GC activity, frequency duration For each resource metric (memory, GC, handles, threads, etc.) Measure momentum (rate and size of advances vs. declines) Momentum Oscillator Resource leaks can not be determined simply by exceeding some predefined threshold 45% 45% 10% 40% 40% 20% 35% 60% 5% 30% 20% 50%

Leaking Chart Pattern Detecting Resource Accumulation VM Heap Usage % VM Heap Usage %

Leaking Chart Pattern Detecting GC Duration (ms.) GC Duration

Detecting Resource Leaks using Heap not yet exhausted Momentum Oscillator Leak pattern detected Momentum Oscillator: values between 0 100, difference between the sum of all recent gains and losses in the underlying metric. Value of 50 means that the net difference of gains and losses is zero 0 net gain and loss. Momentum Oscillator Trending higher

Example: Memory Diagnostics

Early Warning System for JVMs: Summary Monitor critical resource indicators Memory usage, GC activity, Handles, Threads For each one measure momentum oscillator Fluctuates between 0 100, where anything above 60 would indicate advances outpacing declines by a significant margin Higher number indicates how aggressive the resource leak is, 80 would indicate a very aggressive resource growth, regardless of the actual usage numbers for each metric Alert, notify/act when one or more momentum oscillators breaches a threshold Time to avoid downtime, provision, diagnose Time to avoid crisis mode, performance degradation

Visit us at: For more information www.nastel.com Questions: info@nastel.com Twitter: twitter.com/nastel FaceBook: facebook.com/nasteltechnologies LinkedIn: linkedin.com/companies/nastel technologies Phone: +1.800.580.2344 15