Skip to main content

Beat the Clock

Posted by editor on June 23, 2008 at 6:55 AM PDT

Performance and debugging tools getting better

Since it's been a while since I wrote anything really big -- I used to say that Java gets interesting and scripting languages get impractical around 10,000 lines -- I feel like I've fallen behind in terms of what's happening on the performance and debugging front. I recently saw a demo of the "instruments" used for Mac OS X debugging and came away highly impressed. Along with traditional tools for tracing back through an object's allocation stack to see where your leaks are coming from, they have tools specific to the pathologies of Cocoa programming, like tracking "zombies", deallocated objects that still have pointers to them. While Java's memory management protects us from those problems, I came away thinking that tools adapted to the specific problems that Java developers typically face would be highly useful. And for all I know, these may already exist in NetBeans and the like; I just haven't had cause to go looking for them.

On the other hand, if they don't, then what kind of programming anti-patterns would you like a problem-specific debugging tool help you with? Leaking memory because you've mistakenly added or inserted something into a collection, with no corresponding remove? Race conditions because you make calls from multiple threads into thread-unsafe code? What other common mistakes are out there that could be tooled out of existence?

Helping you to debug and speed up your code, this week's Spotlight is on

BTrace, a safe, dynamic tracing tool for the Java platform. BTrace can be used to dynamically trace a running
Java program (similar to DTrace for OpenSolaris applications and OS). BTrace dynamically instruments the classes of the target application to inject tracing code
("bytecode tracing"). Tracing code is expressed in Java programming language. There is also integration with
DTrace for the OpenSolaris platform. There will be a VisualVM plugin
for BTrace soon - so that the users can trace their application from the VisualVM client. Alternatively, if you'd prefer you can run BTrace from command line shells as well. BTrace is available under GNU Public License v.2 w/Classpath Exception.

In Java Today,
the new Atmosphere project "is a POJO based framework using Inversion of Control (IoC) to bring push/Comet to the masses. Finally a framework which can run on any Java based Web Server, including Tomcat, Jetty, GlassFish, Resin, Jersey, RESTlet etc., without having to wait for Servlet 3.0 or without the need to learn how push/Comet support has been differently implemented by all those Containers." The Aquarium has more details about the project's launch in Bringing Comet to the Masses - Atmosphere.

A new SDN tutorial introduces techniques for Using the Scene Graph to Present Visual Objects in JavaFX Script. "This article describes a demo that uses the scene graph features in JavaFX. The demo provides nodes with three different types of contents and enables the user to apply animation and translucency effects. The user can select any combination of nodes to make them visible. The data binding mechanism is extensively used in this demo, providing an automatic synchronization of GUI elements and application data."

eBay team lead Cees de Groot has returned from TheServerSide Symposium convinced that scaling is the biggest issue Java developers will face in coming years, as he discusses in the Artima blog Java going bigger, bigger, bigger. "Scaling is something that every Java developer is going to have to deal with as hardware is converting to multi-cores. Two is the norm today, but we were told to expect a doubling of cores every 18 months or so (yup, Moore's law still seems to hold), meaning that a measly notebook will likely have 8 cores in three years, and servers will typically ship with 32 cores. In order to use that horsepower, software needs to change to parallelism which means that every Java developer has to read up on multi-threading, synchronization (and why you should avoid both), java.util.concurrent (and why you want it), etcetera."

In today's Weblogs, Fabrizio