• No results found

Eclipse Memory Analyzer and other Java stuff

N/A
N/A
Protected

Academic year: 2021

Share "Eclipse Memory Analyzer and other Java stuff"

Copied!
22
0
0

Loading.... (view fulltext now)

Full text

(1)

Eclipse Memory Analyzer

… and other Java stuff

Jan Rehwaldt

(2)

PROFILING IN THE JVM

(3)

JVM Tool Interface

Comprehensive interface for programming

and monitoring tools

(≥ JDK 4; before: JVM PI + DI)

Allows inspecting state and control execution

of applications run in the JVM

Support for

profiling

, debugging, monitoring,

(4)

Profiling in the JVM

JDK tools

jmap, jinfo, jps, jstack, jconsole, jvisualvm, ...

Comprehensive Profiling Tools

VisualVM

(free; included with ≥ JDK 6u7; lightwight)

NetBeans profiler

(free; embedded in IDE)

YourKit

(free for open-source projects)

JProfiler

(free for open-source projects)

(5)
(6)

Profiling in the JVM: VisualVM

Package-level restriction

Profiling using instrumentation

(7)

Profiling in the JVM: VisualVM

Statistics (JVM, GC, …)

Thread Monitoring

Sampling

Profiling

Tracer (BTrace)

(8)
(9)

Eclipse Memory Analyzer

Show memory structure of Java programs

Not while runtime, but generally based on

heap dumps

often post-mortem

hprof file generated by Oracle JVM

(experimental format)

phd file generated by IBM JVM

(10)
(11)

Heap dump

jmap

(included in JDK)

jmap -dump:format=b <pid>

Aquire heap dump

(inside Eclipse Memory Analyzer; uses jmap)

On OutOfMemory

(flag: -XX:+HeapDumpOnOutOfMemoryError)

(12)

Eclipse Memory Analyzer – when?

Helps:

Find memory wasting datastructures

Indicate misuse of Java datatypes

Find memory leaks

Improve code by checking impacts of refactorings

by comparing heap dumps

(13)

Eclipse Memory Analyzer – when not?

Does not help:

Threading issues, wrong / missing variable

assignments and other debuggable problems: No

debugging or stepping

Where has an object been created?

(14)

Demo: MAT Roundtrip

#ID

Sex

Culture

Forename

Surname

Address

1 M Unk Jan Rehwaldt Pusemukkel 4 …

2 M Eng James Albright …

3 F Rus Svetlana Dyakonova Newski Prospekt 106 …

4 M Est Epp Sibul Uus 20 …

5 F Rus Sveta D. Newskoi P. 106 …

6 Usa Mr. Nobel Prize NSA Headquarter …

7 J Usa Mr. Obama The White House …

8 Eng Jamie Albritt Unknown …

9 M Por Sebastian Serano Rosa Carreras …

10 F Por Ana Abílio Heaven 9 …

11 F Ger Jahn Rehfeld Pusem. 4a …

12 F Eng Rita Brown Trafalgar Square 13 …

13 M Unk Mirko Janukowitz Kirsi 6 …

(15)

Demo: MAT Roundtrip

#ID

Sex

Culture

Forename

Surname

Address

1 M Unk Jan Rehwaldt Pusemukkel 4 …

2 M Eng James Albright …

3 F Rus Svetlana Dyakonova Newski Prospekt 106 …

4 M Est Epp Sibul Uus 20 …

5 F Rus Sveta D. Newskoi P. 106 …

6 Usa Mr. Nobel Prize NSA Headquarter …

7 J Usa Mr. Obama The White House …

8 Eng Jamie Albritt Unknown …

9 M Por Sebastian Serano Rosa Carreras …

10 F Por Ana Abílio Heaven 9 …

11 F Ger Jahn Rehfeld Pusem. 4a …

12 F Eng Rita Brown Trafalgar Square 13 …

(16)
(17)
(18)
(19)
(20)

Object Query Language (OQL)

All GroupingPartitions

(21)

Pros and Cons

Pros

Very (most?!) powerful and comprehensive

Provides hints for memory wastes

Cons

Very complicated handling

(22)

Sources

http://eclipsesource.com/blogs/2013/01/21/1

0-tips-for-using-the-eclipse-memory-analyzer/

http://docs.oracle.com/javase/tutorial/java/n

utsandbolts/datatypes.html

MAT Tutorials & Cheat Sheet

References

Related documents

the simulation purposes and hysteresis model (7) can be used in the estimating of the external force acting on piezo actuator in the case that lumped disturbance is known.. In

(e) Unless otherwise required by law, a lawyer shall not present, participate in presenting, or threaten to present criminal charges or professional misconduct allegations solely

3 Attack Model C.: Malicious nodes launch DoR attacks to reduce the target nodes’ reputation and cause them to be evicted from their TGrps: Although these attacks can be successful,

Constrained TGTs unify Webathena’s service-ticket-based credential delegation with Kerberos as used today. Servers acting on behalf of a user now act identically to a user’s

If you, or a member of your household, have home, contents, motor, or boat insurance with us, you are only entitled to payment of this benefit under one policy or section of a

General Description This header content module contains required and optional healthcare provider person information.. Opt and Card Participation/ Act

For example, untimely filing of claims usually results in loss of benefits for week(s) that were not claimed in a timely manner; voluntarily leaving work without good

The results obtained from the present experiment shows adequate phosphorus nutrition to Bt cotton, whether due to phosphorus fertilizer in the soil or due to