Académique Documents
Professionnel Documents
Culture Documents
With a garbage memory collector, are memory leaks a thing of the past with
Java?
Not exactly. Resource leaks, memory misuse, aggressive caches, and
improperly scoped user data can lead to down servers, poor performance, and
major headaches for any application team.
In this session, well discuss how to diagnose memory leaks in user loaded
production applications and review a series of best practices you can use when
first approaching JVM heap issues.
Too many objects (or objects too large in size) are spawned per
transaction.
If too many transactions are called in a small time period, the load on
the system will cause many Java objects to be created and then quickly
destroyed, placing extra burden on the garbage collector.
Examples:
Transactions that dynamically create or pull into memory bloated objects
such as
Images; Database CLOB, LOB, or BLOB; PDF
Detection:
Look at aggregate Java heap for fluctuating saw-tooth in each time
period. Monitor instance counts of major objects tied to transactions,
such as database related objects like ResultSets.
Copyright 2005 Wily Technology, Inc. All Rights Reserved.
CONFIDENTIAL
Management by Restart
As problems arise in production, typically it is hard to diagnose because the
problem is not reproducible in load testing. Then you get stuck in the dreaded
App is Down
Again!!!
Management
By Forced
Restarts
Hours Later
Restart App
10
11
12
Analysis of GC data can lead to areas which can be tweaked via numeric values.
But first understand the application memory usage in detail.
Examples: Ratios, Size, Max, Min, Thresholds
13
14
15
To determine if maximum heap setting is too low, you must do the following:
16
17
18
Look at growth of database objects during user load. Frequently there is direct
correlation with growth in heap.
19
20
An effective means of
determining
relationship between
memory and load is
watching memory as
sessions are
invalidated.
21
22
23
LeakHunter automatically finds the fastest growing data structures in the entire JVM.
Real leaks
possess growth
slopes that
match GC Heap
growth.
24
Q&A