1. Trang chủ
  2. » Khoa Học Tự Nhiên

Java performance tunin

569 77 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 569
Dung lượng 2,81 MB

Nội dung

This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [ Team LiB ] • • • • • • Table of Contents Index Reviews Examples Reader Reviews Errata Java™ Performance Tuning, 2nd Edition By Jack Shirazi Publisher Pub Date ISBN Pages : O'Reilly : January 2003 : 0-596-00377-3 : 588 Java Peformance Tuning, 2nd edition provides a comprehensive and indispensable guide to eliminating all types of performance problems Using many real-life examples to work through the tuning process in detail, JPT shows how tricks such as minimizing object creation and replacing strings with arrays can really pay off in improving your code's performance Tuning J2EE applications bears many similarities to tuning J2SE apps, but important and specific considerations apply For this reason, Java Performance Tuning, Second Edition includes four new chapters: a new chapter on J2EE application tuning in general followed by chapters on tuning JDBC, servlets and JSPs, and EJBs This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [ Team LiB ] • • • • • • Table of Contents Index Reviews Examples Reader Reviews Errata Java™ Performance Tuning, 2nd Edition By Jack Shirazi Publisher Pub Date ISBN Pages : O'Reilly : January 2003 : 0-596-00377-3 : 588 Copyright Preface Contents of This Book New in the Second Edition Virtual Machine (VM) Versions Conventions Used in This Book Comments and Questions Acknowledgments Chapter Introduction Section 1.1 Why Is It Slow? Section 1.2 The Tuning Game Section 1.3 System Limitations and What to Tune Section 1.4 A Tuning Strategy Section 1.5 Perceived Performance Section 1.6 Starting to Tune Section 1.7 What to Measure Section 1.8 Don't Tune What You Don't Need to Tune Section 1.9 Performance Checklist Chapter Profiling Tools Section 2.1 Measurements and Timings Section 2.2 Garbage Collection Section 2.3 Method Calls This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Section 2.3 Section 2.4 Section 2.5 Section 2.6 Section 2.7 Method Calls Object-Creation Profiling Monitoring Gross Memory Usage Client/Server Communications Performance Checklist Chapter Underlying JDK Improvements Section 3.1 Garbage Collection Section 3.2 Tuning the Heap Section 3.3 Gross Tuning Section 3.4 Fine-Tuning the Heap Section 3.5 Sharing Memory Section 3.6 Replacing JDK Classes Section 3.7 Faster VMs Section 3.8 Better Optimizing Compilers Section 3.9 Sun's Compiler and Runtime Optimizations Section 3.10 Compile to Native Machine Code Section 3.11 Native Method Calls Section 3.12 Uncompressed ZIP/JAR Files Section 3.13 Performance Checklist Chapter Object Creation Section 4.1 Object-Creation Statistics Section 4.2 Object Reuse Section 4.3 Reference Objects Section 4.4 Avoiding Garbage Collection Section 4.5 Initialization Section 4.6 Early and Late Initialization Section 4.7 Performance Checklist Chapter Strings Section 5.1 The Performance Effects of Strings Section 5.2 Compile-Time Versus Runtime Resolution of Strings Section 5.3 Conversions to Strings Section 5.4 Strings Versus char Arrays Section 5.5 String Comparisons and Searches Section 5.6 Sorting Internationalized Strings Section 5.7 Performance Checklist Chapter Exceptions, Assertions, Casts, and Variables Section 6.1 Exceptions Section 6.2 Assertions Section 6.3 Casts Section 6.4 Variables Section 6.5 Method Parameters Section 6.6 Performance Checklist Chapter Loops, Switches, and Recursion Section 7.1 Loops Section 7.2 Tuning a Loop Section 7.3 Exception-Terminated Loops Section 7.4 Switches Section 7.5 Recursion Section 7.6 Recursion and Stacks This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Section 7.7 Performance Checklist Chapter I/O, Logging, and Console Output Section 8.1 Replacing System.out Section 8.2 Logging Section 8.3 From Raw I/O to Smokin' I/O Section 8.4 Serialization Section 8.5 Clustering Objects and Counting I/O Operations Section 8.6 Compression Section 8.7 NIO Section 8.8 Performance Checklist Chapter Sorting Section 9.1 Avoiding Unnecessary Sorting Overhead Section 9.2 An Efficient Sorting Framework Section 9.3 Better Than O(nlogn) Sorting Section 9.4 Performance Checklist Chapter 10 Threading Section 10.1 User-Interface Thread and Other Threads Section 10.2 Race Conditions Section 10.3 Deadlocks Section 10.4 Synchronization Overhead Section 10.5 Timing Multithreaded Tests Section 10.6 Atomic Access and Assignment Section 10.7 Thread Pools Section 10.8 Load Balancing Section 10.9 Threaded Problem-Solving Strategies Section 10.10 Performance Checklist Chapter 11 Appropriate Data Structures and Algorithms Section 11.1 Collections Section 11.2 Java Collections Section 11.3 Hashtables and HashMaps Section 11.4 Optimizing Queries Section 11.5 Comparing LinkedLists and ArrayLists Section 11.6 The RandomAccess Interface Section 11.7 Cached Access Section 11.8 Caching Examples Section 11.9 Finding the Index for Partially Matched Strings Section 11.10 Search Trees Section 11.11 Performance Checklist Chapter 12 Distributed Computing Section 12.1 Tools Section 12.2 Message Reduction Section 12.3 Comparing Communications Layers Section 12.4 Caching Section 12.5 Batching I Section 12.6 Application Partitioning Section 12.7 Batching II Section 12.8 Low-Level Communication Optimizations Section 12.9 Distributed Garbage Collection Section 12.10 Databases This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Section 12.10 Databases Section 12.11 Web Services Section 12.12 Performance Checklist Chapter 13 When to Optimize Section 13.1 When Not to Optimize Section 13.2 Tuning Class Libraries and Beans Section 13.3 Analysis Section 13.4 Design and Architecture Section 13.5 Tuning After Deployment Section 13.6 More Factors That Affect Performance Section 13.7 Performance Planning Section 13.8 Performance Checklist Chapter 14 Underlying Operating System and Network Improvements Section 14.1 Hard Disks Section 14.2 CPU Section 14.3 RAM Section 14.4 Network I/O Section 14.5 Performance Checklist Chapter 15 J2EE Performance Tuning Section 15.1 Performance Planning Section 15.2 J2EE Monitoring and Profiling Tools Section 15.3 Measurements: What, Where, and How Section 15.4 Load Testing Section 15.5 User Perception Section 15.6 Clustering and Load Balancing Section 15.7 Tuning JMS Section 15.8 Performance Checklist Chapter 16 Tuning JDBC Section 16.1 Measuring JDBC Performance Section 16.2 Tuning JDBC Section 16.3 Performance Checklist Chapter 17 Tuning Servlets and JSPs Section 17.1 Don't Use SingleThreadModel Section 17.2 Efficient Page Creation and Output Section 17.3 Body Tags Section 17.4 Cache Tags Section 17.5 HttpSession Section 17.6 Compression Section 17.7 More Performance Tips Section 17.8 Case Study: Ace's Hardware SPECmine Tool Section 17.9 Performance Checklist Chapter 18 Tuning EJBs Section 18.1 Primary Design Guidelines Section 18.2 Performance-Optimizing Design Patterns Section 18.3 The Application Server Section 18.4 More Suggestions for Tuning EJBs Section 18.5 Case Study: The Pet Store Section 18.6 Case Study: Elite.com This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Section 18.7 Performance Checklist Chapter 19 Further Resources Section 19.1 The Primary Resource Section 19.2 Books Section 19.3 Magazines Section 19.4 URLs Section 19.5 Profilers Section 19.6 Optimizers Colophon Index This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [ Team LiB ] Copyright Copyright © 2003, 2000 O'Reilly & Associates, Inc Printed in the United States of America Published by O'Reilly & Associates, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472 O'Reilly & Associates books may be purchased for educational, business, or sales promotional use Online editions are also available for most titles (http://safari.oreilly.com) For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly & Associates, Inc Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks Where those designations appear in this book, and O'Reilly & Associates, Inc was aware of a trademark claim, the designations have been printed in caps or initial caps The association between the image of a serval and the topic of Java performance tuning is a trademark of O'Reilly & Associates, Inc Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc., in the United States and other countries While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [ Team LiB ] Preface Performance has been an important issue with Java™ since the first version hit the Web years ago Making those first interpreted programs run fast enough was a huge challenge for many developers Since then, Java performance has improved enormously, and any Java program can now be made to run fast enough provided you avoid the main performance pitfalls This book provides all the details a developer needs to performance-tune any type of Java program I give step-by-step instructions on all aspects of the performance-tuning process, from early considerations such as setting goals, measuring performance, and choosing a compiler, to detailed examples on using profiling tools and applying the results to tune the code This is not an entry-level book about Java, but you not need any previous tuning knowledge to benefit from reading it Many of the tuning techniques presented in this book lead to an increased maintenance cost, so they should not be applied arbitrarily Change your code only when a bottleneck has been identified, and never change the design of your application for minor performance gains This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [ Team LiB ] Contents of This Book Chapter gives general guidelines on how to tune If you not yet have a tuning strategy, this chapter provides a methodical tuning process Chapter covers the tools you need to use while tuning Chapter looks at the SDK, including Virtual Machines (VMs) and compilers Chapter through Chapter 12 cover various techniques you can apply to Java code Chapter 12 looks at tuning techniques specific to distributed applications Chapter 13 steps back from the low-level code-tuning techniques examined throughout most of the book and considers tuning at all other stages of the development process Chapter 14 is a quick look at some operating system-level tuning techniques Chapter 15 through Chapter 18 are new in this edition, providing the information you need to tune J2EE applications Chapter 15 describes tuning considerations that are common to all J2EE applications Chapter 16 looks at specifics for tuning JDBC, including optimizing transactions and SQL, while Chapter 17 provides important information for speeding up servlets and JSPs Chapter 18 describes performance considerations for Enterprise JavaBeans (EJBs) Finally, Chapter 19 covers a wide range of additional resources where you can learn more about Java performance tuning Substantive chapters include a performance-tuning checklist at the end Use these lists to ensure that you have not missed any core tuning techniques while you are tuning This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [ Team LiB ] New in the Second Edition All test results have been updated using the latest versions of the VMs available, including the VMs released with SDK 1.4 The previous edition used Versions 1.1.6, 1.2.0, 1.3.0, and HotSpot 1.0 This edition uses Versions 1.1.8, 1.2.2, 1.3.1_02, and 1.4.0 (which effectively includes HotSpot Version 3.0) This edition has been thoroughly updated and expanded Table P-1 provides an overview of material that is new or significantly expanded in this edition Table P-1 Second edition highlights Topic Analyzing garbage-collection statistics -Xaprof allocation profiler Heap tuning Reference types SoftReference flushing WeakHashMap Regular expression tuning Assertions NIO Atomic access Optimizing collection queries LinkedLists versus ArrayLists RandomAccess interface Collection classes added in SDK 1.4 Web services Performance planning J2EE performance tuning JDBC Servlets and JSPs Enterprise JavaBeans Covered in Chapter Chapter Chapter Chapter Chapter Chapter Chapter Chapter Chapter Chapter 10 Chapter 11 Chapter 11 Chapter 11 Chapter 11 Chapter 12 Chapter 13 Chapter 15 Chapter 16 Chapter 17 Chapter 18 This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com DNS, running locally downtime J2EE monitors for measuring total server-side service time relay RMI, enabling call tracing ServerObjectCacher class (example) TCP/IP web servers performance problems caused by 2nd Web Services, method execution time ServerSessionPool interface ServerSocket class bind( ) ServerSocketChannel class accept( ) open( ) Service Locator pattern in EJB design service providers, probing configuration and connection to ServletContext class caching moving session data to HttpSession ServletOutputStream class servlets doGet( ) and doPost( ) methods, execution times logging capabilities for web server layer network improvements tuning body tags, use of cache tags case study (Ace Hardware SPECmine tool) compression, using efficient page creation and output HttpSession more performance tips performance checklist SingleThreadModel, avoiding use of session beans accessing entity beans from nontransactional methods, declaring stateless, speediness of Session Faỗade in EJB design sessions distributing for higher scalability HttpSession vs stateful session beans optimizing use of HttpSession objects screen navigation in reestablished connections serialization of HttpSession objects state information, in-memory replication of storing data in HttpSession instead of ServletContext terminating timing out Set interface set*AssertionStatus( ) methods (Classloader) set-based processing in JDBC setEntityContext( ) setErr( ) (System) setLength( ) (StringBuffer) setMaxinactiveInterval( ) (HttpSession) setMesssageDrivenContext( ) setOut( ) (System) setSessionContext( ) setSize( ) (Vector) setTransactionIsolation( ) (Connection) shared resources connection pools This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com DLLs, caching focusing on in performance prediction locking memory heap tuning and I/O performance and parallelism data parallelism persistent caches testing in simulation or skeleton system transactions short data type changing to ints in arithmetic operations converting to strings short-circuit operators for loops signals, handling for operating systems simulations of applications testing single point of failure, elimination in EJB application server SingleThreadModel interface singleton sorting objects size of collection classes size( ) (WeakHashMap) skeleton classes skeleton version of system, testing for performance Socket class connect( ) customizing for logging SocketChannel class 2nd sockets client, connecting with NIO package client/server communications providing information on tracing load balancing and UDP SockInStreamLogger class (example) SockOutStreamLogger class (example) SockStreamLogger class (example) SoftReference objects, flushing Solaris, file copying tests with old and new I/O sort( ) Arrays class 2nd 3rd timings for Collections class 2nd Sortable class compareTo( ) compareToSortable( ) order fields, accessing directly in quicksort SortableComparator class (example) sorting casts, avoiding with standard sort algorithm and comparison method for a class comparisons, optimizing in database rows, resulting in excessive transfers faster than O(nlogn) framework for efficient generic vs specific internationalized strings merge sort performance checklist quicksort spatial locality of access SPECmine tool (Ace Hardware), case study on optimization SpeedStart program SQL database execution of statements This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com eliminating unnecessary data transfers limiting query returns optimizing performance checklist query optimization in Pet Store application Statement vs PreparedStatement, when to use statements combining multiple operations Stack class 2nd stack traces exception overhead and exceptions, using without sampling with -Xrunhprof stacks recursion and size per thread, setting TCP/IP, performance of startup of applets of caches from disk sweet spots overhead for processes responsiveness of timings and of VMs with threaded class loading stateful beans converting to stateless pooling session beans HttpSession vs prompt removal of stateless beans converting stateful to speediness of stateless objects, benefits of Statement classes, wrapping Statement interface execute( ) PreparedStatement vs when to use statements, assert statements vs others static binding, methods static methods avoiding creation of intermediate objects synchronization of 2nd static pages, displaying quickly static URL generation static variables 2nd 3rd class instance, storing in enabling logging with statically defined database queries statistics [See also profiling tools] analyzing from performance measurements CPU utilization object creation garbage collection and stock quoting service (Web Services) stored procedures performance checklist storing of a value into a variable strategy for performance tuning stream classes for socket logging streaming, for partial results streams appending objects to object, I/O optimization and This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com StreamTokenizer class 2nd replacing for efficiency word counter, char array vs strength reduction StrictMath class String class charAt( ) compareTo( ) equals( ) equalsIgnoreCase( ) intern( ) 2nd 3rd iterating directly on underlying char array length( ) matches( ) replacing with your own version substring( ) toLowercase( ) toUppercase( ) string literal referents StringBuffer class advantages of appending ints disadvantages of using instead of concatenation (+) operator strings C language canonicalizing 2nd char arrays vs line filter example line filtering with regular expressions word-counting example comparisons and searches compilation compile-time vs runtime resolution concatenating 2nd 3rd 4th at runtime conversions to bytes, shorts, chars and booleans doubles floats ints longs objects immutability of internationalized, sorting lists of, avoiding casts with optimization of string-handling in Pet Shop code partially matched, finding index for performance checklist performance effects of advanatages disadvantages processing in I/O replacing with enumerated constants in servlet output, using efficiently SQL statement execution substring operation StringWriter class striping, disk stubs, replacing object instance variables with subexpressions, eliminating common substring( ) (String) subsystems, optimized for EJB application server super( ) swap files 2nd 3rd swap space, increasing This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com switches array access, converting to case statement reordering by optimizing compiler contiguous sets of cases converting to array access non-contiguous values for cases performance checklist speedup for VMs using exception-driven loop termination SwitchTest class (example) Symantec development environment, I/O operations synchronization ArrayList and Vector classes atomic access and assignment ordering collection queries, avoiding in desynchronization and synchronized wrappers distributed caching with, EJB application server increment( ) lockable update method multithreaded tests, timing overhead of serialized execution, avoiding performance checklist for servlet activities threads counter incrementation monitors and unnecessary, avoiding synchronized keyword 2nd 3rd System class arraycopy( ) currentTimeMillis( ) 2nd 3rd gc( ) disabling setErr( ) setOut( ) system level I/O System.out, replacing systems bottlenecks in load balancing example limitations of noting changes to throughput, measuring in benchmarking This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [ Team LiB ] [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] tail recursion task manager (Windows) task queue TCP/IP communication rate on congested networks load balancing with servers stacks network I/O and 2nd tuneable parameters tcpdump (communication-monitoring tool) temporal locality of access temporary objects avoiding creation of appending objects to streams char array vs StreamTokenizer avoiding in long to string conversion reducing number of temporary variables of primitive data types vs temporary variables avoiding repeated casts with frequently manipulated array elements, assigning to local variables as loops, speeding up with primitive data types, using instead of object types terminating loops with exceptions speedup for various VMs using termination tests for loops, avoiding method calls in ternary search trees digital trie, using with recursion, converting to iteration TernarySearchTree class access and update times compared with HashMap tuning TernarySearchTreeNode class test environment for performance, creating testing inacurrate results from performance and tuning using results simulation or skeleton system with small differences in timings this( ) thread safety (SingleThreadModel) thread=y option (-Xrunhprof) threaded class loading ThreadedAccess class (example) ThreadLocal class threads atomic access and assignment deadlocked listing, utilities for load balancing classes for example of TCP/IP, using locking multithreaded tests, timing object local to current thread perceived performance and performance checklist pooling This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com EJB application server startup overhead, reducing problem-solving strategies race conditions runnable queue of sleeping restlessly stack size, setting synchronization monitors and overhead of user-interface and other throughput applications disk statistics on, analyzing system, measuring in benchmarking tight loops time exceptions, cost of measurements for benchmarks 2nd measurements for distributed applications time-to-live values for SoftReferences timeouts setting for client-initiated transactions in EJB specifying timestamps timing out sessions timings caching, effects on profilers and tmpfs toLowercase( ) (String) top utility toString( ) Boolean class Integer class Long class Object class StringBuffer class Vector class totalMemory( ) (Runtime) toUpperCase( ) (String) 2nd trace statements traceMethodCalls( ) (Runtime) training users transaction logs transactional access to databases transactions analyzing in application development design-stage decisions about distributed, management by EJB application server EJB performance checklist tuning JDBC, optimizing in auto-commit mode non-ACID transaction problems performance checklist savepoints and distributed transactions transaction levels user-controlled transactions JMS messages, transactional and nontransactional optimistic, support by EJB application server optimizing rates of, analyzing statistics on transfer layers, measuring performance of This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com transfer rates, disks 2nd transferFrom( ) (FileChannel) transferring data minimizing in JDBC operations Page-by-Page Iterator pattern in EJB reducing costs with data duplication reducing network transfers with Value Objects in EJB ValueListHandler pattern in EJB transferTo( ) (FileChannel) transient fields, avoiding serialization of transient modifier translations between programming languages tree structures (search trees) TreeMap class 2nd TreeSet class trie structures try-catch blocks with exceptions, cost of without exceptions, cost of tuning distributed applications EJB application servers EJBs additional suggestions for Elite.com case study Pet Store case study tuning performance [See also related entries under individual topics] avoiding unneeded benchmarks, setting measurements multiuser applications strategy for 2nd identifying bottlenecks systematically user expectations for performance tutorial application (Pet Store) This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [ Team LiB ] [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] UDP network bottlenecks and resending packets on congested networks sockets unicast messaging UnicastRemoteObject class Unicode Unix communication-monitoring tools CPU monitoring disk usage 2nd file descriptors, monitoring availability of forking processes on generating stack dumps measuring network bandwidth memory-mapped filesystem netstart utility paging, monitoring priority of processes process and thread-listing utiilities profiling object creation unmarshalling objects unrolling loops 2nd unSetEntityContext( ) updates arrays of primitive types vs object arrays costs of different types database batching in JDBC eliminating unnecessary (example) optimizing objects for URLClassLoader class 2nd URLs Java performance tuning resources load balancing based on useBean action User Datagram Protocol [See UDP] user interface usability user-controlled transactions user-interface thread and others users expectations for performance multiple, benchmarking and number simultaneously using application performance perception of latency and statistics on, analyzing training utilization, CPU analyzing statistics on measuring This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [ Team LiB ] [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] Value Object Assembler pattern in EJB design Value Objects in EJB design ValueListHandler pattern in EJB valueUnbound( ) (HttpSessionBinderListener) variables array element access vs., cost of casting repeatedly class, static vs instance corrupt 2nd 3rd unsynchronized classes and default initialization values in Java heap local multithreaded, atomic access and assignment performance checklist primitive types, replacing with ints public instance variables, accessing shared between threads, corruption of static 2nd enabling logging with storing class instances in volatile Vector class 2nd 3rd [See also ArrayList class] appending to streams generic capabilities of, performance and implementation with underlying String[ ] array setSize( ) synchronization toString( ) unsynchronized, synchronized wrapper vs VectorPoolManager class (example) vectors handles to, memory reuse caused by pool management and for threads verbose option Verified Service Locator pattern in EJB design version management, hot-deploy and hot-undeploy applications for virtual memory VMs (virtual machines) [See also -verbosegc option] -verbosegc option Sun JDK 1.2 output with -Xloggc: option application distribution over client/server modes, calculation of free space in heap EJBs located within, local communications among eliminating disabled assertion statements faster other optimizations startup time variations in speed generating helpful information for heap size [See also heap, tuning] tuning for EJB application servers HotSpot, speeding up code multiple, using for load balancing optimizations for number comparisons RandomAccess, compatibility with runtime initializations speedup using exception-driven loop termination This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com synchronized methods, overhead of vmstat utility volatile keyword This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [ Team LiB ] [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] wait( ) (Object) weak references, canonicalized objects and WeakHashMap class WeakReference class object canonicalization and web browsers perceived performance and profiling data transfers web pages [See page display pages] web servers downloading many pages from overloading by downloading many pages at high access rate performance problems with 2nd Web Services asynchronous processing CORBA vs granularity of methods high-performance load balancing measuring performance 2nd DNS lookup time marshalling time network communication time round-trip overhead, inferring round-trip time server-side method execution performance advantages and disadvantages Web Services Description Language (WSDL) Windows CPU monitoring file copying tests fork procedures on measuring network bandwidth memory-mapped filesystem monitoring open files and sockets netstart utility ObjectCreationMonitoring class, executing paging, monitoring profiling object creation stack dumps, generating task manager and performance monitor utilities TCP/IP stacks words, counting (example) wrappers ConnectionWrapper class JDBC caching with Proxy and Decorator patterns, wrapping objects with synchronized 2nd write( ) GatheringByteChannel OutputStream class SocketChannel class writeExternal (Externalizable) writeObject( ) (Serializable) 2nd Writer class appendTo( ) WSDL (Web Services Description Language) This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [ Team LiB ] [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] XAConnection interface XADataSource interface Xrun option, Xrunhprof option and This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [ Team LiB ] [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] ZIP files (uncompressed), for class delivery This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Brought to You by Like the book? Buy it! ... 15.7 Tuning JMS Section 15.8 Performance Checklist Chapter 16 Tuning JDBC Section 16.1 Measuring JDBC Performance Section 16.2 Tuning JDBC Section 16.3 Performance Checklist Chapter 17 Tuning... association between the image of a serval and the topic of Java performance tuning is a trademark of O'Reilly & Associates, Inc Java and all Java- based trademarks and logos are trademarks or registered... to performance- tune any type of Java program I give step-by-step instructions on all aspects of the performance- tuning process, from early considerations such as setting goals, measuring performance,

Ngày đăng: 25/03/2019, 15:43

w