Java™ SE Performance Tuning Revision A
Total Page:16
File Type:pdf, Size:1020Kb
Java™ SE Performance Tuning Revision A SEM-DTJ-380-LA Copyright 2008 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Sun, Sun Microsystems, the Sun logo, the Duke logo, Java, JavaServer Pages, JSP, Java HotSpot, Java VisualVM, Sun Fire T1000, Sun Fire T2000, UltraSparc, NetBeans, NetBeans Profiler, Sun Studio, and JavaScript are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. The OPEN LOOK and Sun Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun's licensees who implement OPEN LOOK GUIs and otherwise comply with Sun's written license agreements. Federal Acquisitions: Commercial Software Government Users Subject to Standard License Terms and Conditions Export Laws. Products, Services, and technical data delivered by Sun may be subject to U.S. export controls or the trade laws of other countries. You will comply with all such laws and obtain all licenses to export, re-export, or import as may be required after delivery to You. You will not export or re-export to entities on the most current U.S. export exclusions lists or to any country subject to U.S. embargo or terrorist controls as specified in the U.S. export laws. You will not use or provide Products, Services, or technical data for nuclear, missile, or chemical biological weaponry end uses. DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS, AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. Export Control Classification Number (ECCN) assigned:EAR99 Copyright 2008 Sun Microsystems Inc., 4150 Network Circle, Santa Clara, California 95054, Etats-Unis. Tous droits ré servé s. Ce produit ou document est proté gé par un copyright et distribué avec des licences qui en restreignent l'utilisation, la copie, la distribution, et la dé compilation. Aucune partie de ce produit ou document ne peut ê tre reproduite sous aucune forme, par quelque moyen que ce soit, sans l'autorisation pré alable et é crite de Sun et de ses bailleurs de licence, s'il y en a. Le logiciel dé tenu par des tiers, et qui comprend la technologie relative aux polices de caractè res, est proté gé par un copyright et licencié par des fournisseurs de Sun. Sun, Sun Microsystems, the Sun logo, the Duke logo, Java, JavaServer Pages, JSP, Java HotSpot, Java VisualVM, Sun Fire T1000, Sun Fire T2000, UltraSparc, NetBeans, NetBeans Profiler, Sun Studio et JavaScript sont des marques de fabrique ou des marques dé posé es de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays. L'interfaces d'utilisation graphique OPEN LOOK et Sun a é té dé veloppé e par Sun Microsystems, Inc. pour ses utilisateurs et licencié s. Sun reconnaît les efforts de pionniers de Xerox pour larecherche et le dé veloppement du concept des interfaces d'utilisation visuelle ou graphique pour l'industrie de l'informatique. Sun dé tient une licence non exclusive de Xerox sur l'interface d'utilisation graphique Xerox, cette licence couvrant é galement les licencié s de Sun qui mettent en place l'interface d'utilisation graphique OPEN LOOK et qui en outre se conforment aux licences é crites de Sun. Lé gislation en matiè re dexportations. Les Produits, Services et donné es techniques livré s par Sun peuvent ê tre soumis aux contrô les amé ricains sur les exportations, ou à la lé gislation commerciale dautres pays. Nous nous conformerons à lensemble de ces textes et nous obtiendrons toutes licences dexportation, de ré -exportation ou dimportation susceptibles dê tre requises aprè s livraison à Vous. Vous nexporterez, ni ne ré -exporterez en aucun cas à des entité s figurant sur les listes amé ricaines dinterdiction dexportation les plus courantes, ni vers un quelconque pays soumis à embargo par les Etats-Unis, ou à des contrô les anti-terroristes, comme pré vu par la lé gislation amé ricaine en matiè re dexportations. Vous nutiliserez, ni ne fournirez les Produits, Services ou donné es techniques pour aucune utilisation finale lié e aux armes nuclé aires, chimiques ou biologiques ou aux missiles. LA DOCUMENTATION EST FOURNIE "EN L'ETAT" ET TOUTES AUTRES CONDITIONS, DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFAÇ ON. Course Objectives • Incorporate monitoring, profiling and tuning into the application development life cycle • Monitor the Operating System (OS) layer: Central Processing Unit (CPU), network, disk I/O, virtual memory, processes and locks • Monitor the Java Virtual Machine (JVM) and application layers • Profile the OS, JVM and application layers • Tune garbage collection (GC) The Java™ SE Performance Tuning Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A 4 Course Objectives • Examine and manage the Just in Time (JIT) compiler • Examine JVM ergonomics • Examine 64 bit JVMs • Tune the JVM for multi-core platforms The Java™ SE Performance Tuning Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A 5 Course Overview: What to Expect • Master Java™ SE performance monitoring by learning: > What and where to performance monitor > What to profile and what tools work the best for different use cases > Commonly observed patterns indicating performance issues > How Java™ HotSpot garbage collectors work and how to tune them > What you need to know about the JIT compiler > What is JVM ergonomics and how it works > What you need to know about 64-bit JVMs > How to tune the JVM for specific hardware platforms The Java™ SE Performance Tuning Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A 6 Course Overview: What to Expect • In short, learn the basics of the JVM internals and learn enough about Java™ SE performance to know where to start and what to look for, to enable you to identify and resolve most of the JVM and Java™ performance issues you observe. The Java™ SE Performance Tuning Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A 7 Course Overview: The Nature of Performance Tuning • Performance tuning is largely an art. • There is no one approach that is always necessarily the right approach. • There are performance issues which will require very specialized expertise to identify the root cause, and / or be able to recommend a solution. The Java™ SE Performance Tuning Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A 8 Course Module Outlines ● Module 1: Examining Performance Tuning > Distinguishing between monitoring, profiling and tuning > Incorporating monitoring, profiling and tuning into the application development life cycle ● Module 2: Monitoring the OS Layer > Monitoring CPU utilization > Monitoring network performance > Monitoring disk input output (I/O) > Monitoring memory utilization > Monitoring process behavior The Java™ SE Performance Tuning Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A 9 Course Module Outlines • Module 3: Monitoring the JVM and Application Layers > Examining generational collector architectures > Monitoring GC > Monitoring the JVM > Monitoring the application • Module 4: Profiling the OS, JVM and Application Layers > Examining profiling tools > Profiling CPU usage > Profiling the heap and memory usage > Detecting lock contention The Java™ SE Performance Tuning Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A 10 Course Module Outlines • Module 5: Tuning GC > Tuning collector generation sizes > Selecting the collector that best fits application characteristics and requirements > Examining practices that negatively impact GC performance • Module 6: Examining and Managing the JIT compiler > Examining choices of JIT compilers > Tuning the JIT compiler > Creating micro benchmarks The Java™ SE Performance Tuning Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A 11 Course Module Outlines • Module 7: Examining Ergonomics > Examining JVM ergonomics behavior • Module 8: Using 64 bit JVMs > Examine the issues associated with using 64 bit JVMs > Identify application characteristics that suit 64 bit JVMs > Tuning 64 bit JVM for different application requirements • Module 9: Optimize the JVM for Multi-core platforms > Examining JVM features that can leverage multi-core architectures > Optimize the JVM for various multi-core architectures > Tuning the JVM for the Sun Fire™ T1000/T2000 platform The Java™ SE Performance Tuning Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A 12 Module 1: Examining Performance Tuning SEM-DTJ-380-LA Objectives