VisualVM 1.0 + JDK Integration

VisualVM ist nun in der Version 1.0 final. Ein erstaunliche Neuerung ist, dass Sun VisualVM in das Update 7 von JDK 6 integriert hat; sonst wurden noch nie in Updates neue Tools integriert.

Die wichtigsten Features von der Webseite:

Display local and remote Java applications. VisualVM automatically detects and lists locally and remotely running Java applications (jstatd must be running on the remote host). You can also define applications manually by JMX connection. This way you can easily see what Java applications are running on your system or check if a remote J2EE server process is alive.


Display application configuration and runtime environment. For each application VisualVM shows basic runtime information: PID, main class, arguments passed to java process, JVM version, JDK home, JVM flags and arguments and system properties.


Monitor application memory consumption and runtime behavior. VisualVM monitors application heap and permanent generation memory, number of loaded classes and running threads. You can easily detect suspicious memory consumption and take an action – invoke garbage collection in the application or take a heap dump and browse the contents of application heap.


Monitor application threads. All threads running in a Java process are displayed in a timeline. You can track thread activity and uncover inefficient patterns like blocked Event Dispatch Thread or unused worker threads.


Profile application performance or analyze memory allocation. VisualVM has a built-in application profiler which can visualize where most of the time is being spent or which objects consume most of the memory by just one mouse click without any additional configuration.


Take and display thread dumps. Taking and displaying a thread dump is as easy as clicking a mouse button. You don’t need to deal with the command line at all to determine what’s currently happening in the application. Moreover, simultaneous thread dumps of multiple applications can be taken at once to start uncovering distributed deadlocks.


Take and browse heap dumps. When you need to browse contents of application memory or uncover a memory leak in your application, you’ll find the built-in HeapWalker tool really handy. It can read files written in hprof format and is also able to browse heap dumps created by the JVM on an OutOfMemoryException.


Analyze core dumps. When a Java process crashes, a core dump can be generated by the JVM containing important information about application state at the time of the crash. VisualVM is able to display application configuration and runtime environment and to extract thread and heap dumps from the core dump.


Analyze applications offline. VisualVM is able to save application configuration and runtime environment together with all taken thread dumps, heap dumps and profiler snaphots into a single application snapshot which can be later processed offline. This is especially useful for bug reports where users can provide a single file containing all the necessary information to identify runtime environment and application state.

Die Webseite sieht auch viel schicker aus (was für die anderen java.net-Projekte aber nicht gilt).

Werbung: Wir haben neue/aktualisierte Seminare.

Doclet APIviz für nette UML-Diagramme

APIviz ist ein LGPL-Doclet, welches nicht nur die klassische JavaDoc-API erstellt, sondern gleich dabei noch UML-Diagramme. Die Diagramme werden generiert von http://www.graphviz.org/.

Hier ein Beispiel, wie das nach dem Erzeugen aussieht:

net.gleamynode.netty.buffer
Class HeapChannelBuffer

java.lang.Object
extended by net.gleamynode.netty.buffer.AbstractChannelBuffer
extended by net.gleamynode.netty.buffer.HeapChannelBuffer

All Implemented Interfaces:
Comparable<ChannelBuffer>, ChannelBuffer
Direct Known Subclasses:
BigEndianHeapChannelBuffer, LittleEndianHeapChannelBuffer

public abstract class HeapChannelBuffer
extends AbstractChannelBuffer

http://netty.googlecode.com/svn/site/api/3.0/net/gleamynode/netty/buffer/HeapChannelBuffer.png

Version:
$Rev$, $Date$
Author:
The Netty Project (netty@googlegroups.com), Trustin Lee (trustin@gmail.com)

Thema der Woche: Rich Internet Applications mit OpenLaszlo und ZK

Statt wie bei vielen Java Web-Frameworks HTML-Seiten in das Zentrum zu stellen, gehen moderne RIA (Rich Internet Applications)-Frameworks einen anderen Weg. Im Mittelpunkt stehen dort XML-Dateien, die die View beschreiben, angereichert mit JavaScript für die Interaktion und das Ansprechen von Services in der Middle-Tier. Drei der bekannten Frameworks sind:

Verschaffe einen Eindruck über die Frameworks mit dem Demos http://www.zkoss.org/demo/, http://www.openlaszlo.org/showcase, http://www.webspiders.com/flex/.

http://www.openlaszlo.org/lps4/laszlo-explorer/index.jsp?lzr=dhtml bietet unter "Laszlo in 10 Minutes " einen Editor auf der einen Seite und eine Ansicht auf der anderen, so dass man über dem Editor, eigene Programme in der Mini-IDE schreiben kann. Entwickle auf diese Weise einen Umrechner von Euro in Dollar.

Installiere den OpenLaszlo Server (http://www.openlaszlo.org/lps4/docs/installation/). Setze den Euro/Dollar-Umrechner in das Verzeichnis. Schreibe eine einfache JSP (oder echten Web-Service über Java 6 wer will; angelehnt an http://rscreeney.wordpress.com/2006/09/19/laszlo-simple-web-service/), die als Service den aktuellen Umrechnugskurs liefert, worauf das eigene OpenLaslo-Programm zurückgreift. (Wer möchte, kann die Lösung gerne hier als Kommentar reinsetzen.)

Sehr interessanter Java/C-Benchmark

Stefan hat unter http://www.stefankrause.net/wp/?p=9 die Ausführungszeit von Programme mit unterschiedliche JVMs und C-Compilern getestet. Zwar misst er keine OOP-Eigenschaften, wie die Heap-Allokation, GC oder Kosten für dynamisch gebundene Methodenaufrufe, aber eben die Effizient für Low-Level-Operationen. Gut zu sehen, dass Java auch da schon extrem gut mithalten kann. Ich hätte die Performance bei arithmetischen Operationen gar nicht so gut eingeschätzt. Im Endeffekt gibt es folgendes Ergebnis:

  • Der GCC-Compiler und die C-Programme sind in der Regel am Schnellsten. Mal ist Suns JVM sogar schneller.
  • Der native-Compiler JET von Excelsior bringt ausgezeichnete Ergebnisse (Platz 2).
  • Der oft gepriesene C-Compiler LLVM ist nicht so gut wie gedacht.
  • Die Performance von Suns JVM schwankt stark. Mal ist sie ausgezeichnet im Gewinnerfeld, mal weit abgeschlagen in der absoluten Verliererzone.

Praxisrelevant sind diese Benchmarks nur zum Teil. Jetzt ist es interessant zu wissen, wie OOP-Eigenschaften vom C++-Compiler oder von JET umgesetzt werden.

Zwei Open-Source Bibs für Java ME Entwicklung

Wer für die Java ME entwickelt, der muss vieles selbst machen, da die CLDC/MIDP-Bibs doch relativ schwach sind. Zwei Open-Source Bibs, die dort Arbeit abnehmen können, sind:

  • kommons – JavaME reusable objects; hat nix mit KDE zu tun 🙂
    The goal of the project kommons is to provide a set of reusable objects useful to make networking, object persistence (Caching), logging, working with Strings (Iso, UTF8) and many more…
  • 59pixels Open Source J2ME Libraries
    Some of the libraries which 59Pixels have built up over the last year. Most of them are the first generation versions and are not as polished or as efficient as they could be but we have been able to distribute our products on over 150 handsets so I’m sure they will be useful to you.

Apache POI 3.1 final

Von http://poi.apache.org, der Open-Source Bib. zum Verarbeiten von MS Excel-, PowerPoint-, Visio- und Word-Dateien, gibt es eine neue Version. Änderungen sind unter anderem:

Highlights in POI-HSSF - Java API To Access Microsoft Excel Format Files:

  • Major improvements in formula evaluation
  • Support for conditional formatting
  • Support for Excel hyperlinks
  • Handling of embedded OLE2 documents
  • Support for getting excel cell comments when extracting text
  • Support for specifying a policy to HSSF on missing / blank cells when fetching

Highlights in POI-HSLF - Java API To Access Microsoft PowerPoint Format Files:

  • Support for getting embedded sounds
  • Support for getting embedded OLE objects
  • Support for Tables
  • Improved text extraction
  • Export PowerPoint slides into image
  • Java2D Graphics driver

Highlights in POI-HWPF - Java API To Access Microsoft Word Format Files

  • Handling of embedded OLE2 documents
  • Support for extracting Escher images from HWPF files
  • Improved Range.replaceText()

Ich bin gespannt, ob sich mit der MS-Initiative, Dokus anzubieten, die Bib. noch weiter und vollständiger entwickeln wird: