+ All Categories
Home > Documents > Memory leak analyse

Memory leak analyse

Date post: 05-Dec-2014
Category:
Upload: bernd-zuther
View: 192 times
Download: 3 times
Share this document with a friend
Description:
 
18
http://www.mongosoup.de/index.html http://bernd-z http://bernd- zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/ wp-content/uploads/2014/05/Memory-Analyzer-OGL.png Memory Leak Analyse [email protected] @Bernd_Z 08.05.2014
Transcript
Page 1: Memory leak analyse

http://www.mongosoup.de/index.html http://bernd-z http://bernd-zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/

wp-content/uploads/2014/05/Memory-Analyzer-OGL.png

Memory Leak Analyse

[email protected] ! @Bernd_Z

08.05.2014

Page 2: Memory leak analyse

Java Memory Model

2

Page 3: Memory leak analyse

http://www.mongosoup.de/index.html http://bernd-z http://bernd-zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/

wp-content/uploads/2014/05/Memory-Analyzer-OGL.png

JConsole (1)

3

berndzuther@Bernds-MacBook-Pro ~ $ jconsole

Page 4: Memory leak analyse

JConsole (2)

seit Java Version 1.5!Applikation zur Überwachung von Java Prozessen via JMX auf lokalen oder entfernten Systemen!Überblick:!

aktuellen Speicherbedarf!Prozessorauslastung!Threads!geladene Klassen

4

Page 5: Memory leak analyse

http://www.mongosoup.de/index.html http://bernd-z http://bernd-zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/

wp-content/uploads/2014/05/Memory-Analyzer-OGL.png

VisualVM (1)

5

http://visualvm.java.net/ berndzuther@Bernds-MacBook-Pro ~ $ jvisualvm

Page 6: Memory leak analyse

VisualVM (2)

seit Java Version 1.6!basiert auf NetBeans!Applikation zur Überwachung lokaler oder entfernter von Java Prozesse!Überblick:!

Anzeigen der Konfigurationen und Umgebungsvariablen!Profilen einer Anwendung!Thread-Dumps!Heap-Dumps

6

Page 7: Memory leak analyse

http://www.mongosoup.de/index.html http://bernd-z http://bernd-zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/

wp-content/uploads/2014/05/Memory-Analyzer-OGL.png

Garbage Collection

7

Page 8: Memory leak analyse

http://www.mongosoup.de/index.html http://bernd-z http://bernd-zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/

wp-content/uploads/2014/05/Memory-Analyzer-OGL.png

Memory Leak (1)

8

public class MyPage extends org.apache.wicket.markup.html.WebPage {!! // reachable via Classloader as soon class is loaded! public static final List STATIC = new ArrayList();!! // as long as the Page is used,! private final List instance = new ArrayList()!! // while this method is executed the List is kept reachable,! // even if it is not used! private void myMethod(List parameter) {! // while this method is running, this list is reachable from the stack! List local = new ArrayList();! }!!}!

Page 9: Memory leak analyse

http://www.mongosoup.de/index.html http://bernd-z http://bernd-zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/

wp-content/uploads/2014/05/Memory-Analyzer-OGL.png

Memory Leak (2)

9

Page 10: Memory leak analyse

http://www.mongosoup.de/index.html http://bernd-z http://bernd-zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/

wp-content/uploads/2014/05/Memory-Analyzer-OGL.png

Heap Dump

10

berndzuther@Bernds-MacBook-Pro ~ $ jps!16497 AppMain!16520 Jps!berndzuther@Bernds-MacBook-Pro ~ $ jmap -dump:live,format=b,file=dump.hprof 16497!Dumping heap to /Users/berndzuther/dump.hprof ...!Heap dump file created!

Page 11: Memory leak analyse

http://www.mongosoup.de/index.html http://bernd-z http://bernd-zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/

wp-content/uploads/2014/05/Memory-Analyzer-OGL.png

JMeter (1)

11https://jmeter.apache.org/

Page 12: Memory leak analyse

JMeter (2)

Java Anwendung, um Lasttest und Performance Messungen zu machen unterstützt die folgenden Protokolle:

Web - HTTP, HTTPS SOAP FTP Database via JDBC

12

Page 13: Memory leak analyse

http://www.mongosoup.de/index.html http://bernd-z http://bernd-zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/

wp-content/uploads/2014/05/Memory-Analyzer-OGL.png

Memory Analyzer (1)

13http://www.eclipse.org/mat/

Page 14: Memory leak analyse

http://www.mongosoup.de/index.html http://bernd-z http://bernd-zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/

wp-content/uploads/2014/05/Memory-Analyzer-OGL.png

Memory Analyzer (2)

14

Page 15: Memory leak analyse

http://www.mongosoup.de/index.html http://bernd-z http://bernd-zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/

wp-content/uploads/2014/05/Memory-Analyzer-OGL.png

Memory Analyzer (3)

15

Page 16: Memory leak analyse

http://www.mongosoup.de/index.html http://bernd-z http://bernd-zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/

wp-content/uploads/2014/05/Memory-Analyzer-OGL.png

Memory Analyzer (4)

Speicheranalyse-Werkzeug!Heap Dump Informationen einzulesen!in vielfacher Art darzustellen!

Suspect Report!Dominator Tree!Object Query Language

16

Page 17: Memory leak analyse

http://www.mongosoup.de/index.html http://bernd-z http://bernd-zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/

wp-content/uploads/2014/05/Memory-Analyzer-OGL.png

Fragen

Page 18: Memory leak analyse

http://www.mongosoup.de/index.html http://bernd-z http://bernd-zuther.de/wp-content/uploads/2014/05/Memory-Analyzer-OGL.png uther.de/

wp-content/uploads/2014/05/Memory-Analyzer-OGL.png

Links

Java OutOfMemoryError – Eine Tragödie in sieben Akten http://bit.ly/1nBsRYG!OutOfMemoryError: Java Heapdump Analyse – Was tun wenn die Produktion spinnthttp://bit.ly/1kMjCA2!Java ist auch eine Insel http://bit.ly/1klsRpn

18


Recommended