SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
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
bernd.zuther@comsysto.com !
@Bernd_Z
08.05.2014
Java Memory Model
2
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
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
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
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
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
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();!
}!
!
}!
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
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!
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)
11
https://jmeter.apache.org/
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
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)
13
http://www.eclipse.org/mat/
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
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
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
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
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 spinnt

http://bit.ly/1kMjCA2!
Java ist auch eine Insel 

http://bit.ly/1klsRpn
18

Weitere ähnliche Inhalte

Mehr von Bernd Zuther

Confess - Microservices and Conversion Hunting - Build architectures for chan...
Confess - Microservices and Conversion Hunting - Build architectures for chan...Confess - Microservices and Conversion Hunting - Build architectures for chan...
Confess - Microservices and Conversion Hunting - Build architectures for chan...Bernd Zuther
 
Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...
Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...
Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...Bernd Zuther
 
Bau dein eigenes extreme feedback device
Bau dein eigenes extreme feedback deviceBau dein eigenes extreme feedback device
Bau dein eigenes extreme feedback deviceBernd Zuther
 
Building an Online-Recommendation Engine with MongoDB
Building an Online-Recommendation Engine with MongoDBBuilding an Online-Recommendation Engine with MongoDB
Building an Online-Recommendation Engine with MongoDBBernd Zuther
 
Building an-online-recommendation-engine-with-mongodb-cebit-hannover
Building an-online-recommendation-engine-with-mongodb-cebit-hannoverBuilding an-online-recommendation-engine-with-mongodb-cebit-hannover
Building an-online-recommendation-engine-with-mongodb-cebit-hannoverBernd Zuther
 
Building an Online-Recommendation Engine with MongoDB
Building an Online-Recommendation Engine with MongoDBBuilding an Online-Recommendation Engine with MongoDB
Building an Online-Recommendation Engine with MongoDBBernd Zuther
 
Building an Online-Recommendation Engine with MongoDB
Building an Online-Recommendation Engine with MongoDBBuilding an Online-Recommendation Engine with MongoDB
Building an Online-Recommendation Engine with MongoDBBernd Zuther
 
Mongodb + Hadoop Big Data Solyanka
Mongodb + Hadoop Big Data SolyankaMongodb + Hadoop Big Data Solyanka
Mongodb + Hadoop Big Data SolyankaBernd Zuther
 
Real time Analytics with MongoDB
Real time Analytics with MongoDBReal time Analytics with MongoDB
Real time Analytics with MongoDBBernd Zuther
 

Mehr von Bernd Zuther (9)

Confess - Microservices and Conversion Hunting - Build architectures for chan...
Confess - Microservices and Conversion Hunting - Build architectures for chan...Confess - Microservices and Conversion Hunting - Build architectures for chan...
Confess - Microservices and Conversion Hunting - Build architectures for chan...
 
Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...
Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...
Javaland 2015 - Bernd Zuther - Die Jagd nach mehr Konversion - Fluch oder Seg...
 
Bau dein eigenes extreme feedback device
Bau dein eigenes extreme feedback deviceBau dein eigenes extreme feedback device
Bau dein eigenes extreme feedback device
 
Building an Online-Recommendation Engine with MongoDB
Building an Online-Recommendation Engine with MongoDBBuilding an Online-Recommendation Engine with MongoDB
Building an Online-Recommendation Engine with MongoDB
 
Building an-online-recommendation-engine-with-mongodb-cebit-hannover
Building an-online-recommendation-engine-with-mongodb-cebit-hannoverBuilding an-online-recommendation-engine-with-mongodb-cebit-hannover
Building an-online-recommendation-engine-with-mongodb-cebit-hannover
 
Building an Online-Recommendation Engine with MongoDB
Building an Online-Recommendation Engine with MongoDBBuilding an Online-Recommendation Engine with MongoDB
Building an Online-Recommendation Engine with MongoDB
 
Building an Online-Recommendation Engine with MongoDB
Building an Online-Recommendation Engine with MongoDBBuilding an Online-Recommendation Engine with MongoDB
Building an Online-Recommendation Engine with MongoDB
 
Mongodb + Hadoop Big Data Solyanka
Mongodb + Hadoop Big Data SolyankaMongodb + Hadoop Big Data Solyanka
Mongodb + Hadoop Big Data Solyanka
 
Real time Analytics with MongoDB
Real time Analytics with MongoDBReal time Analytics with MongoDB
Real time Analytics with MongoDB
 

Memory leak analyse