views:

119

answers:

4

I've got some Java code which builds a data structure (approx 500 small interlinked objects) from data in some files and I'd really like to visualise the resulting structure. I hope that seeing it will allow me to optimise, not the code, but the data itself.

I'm wondering if there is a debugger that will do this or perhaps a way I can dump the data and have a tool build me a pretty graph of the data structure.

I hope that makes sense.

+4  A: 

I've solved this before by dumping all my objects to Dot format, for GraphViz, and then used GraphViz to visualize the data, but not in real time. I had a command that would start a dump visitor that would walk the structure. Anyways it was about a second to dump and a few more to balance the graph when working with about 3000 nodes.

Robert Gould
Edit: added a link to the GraphViz webpage, so I can now delete my own answer which is otherwise a duplicate.
j_random_hacker
Robert Gould
+1  A: 

In C++, the tool I've used for doing something similar is the GNU Data Display Debugger DDD. According to the manual, you can use JDB as the debugging backend. I've never tried it, but it might be worth a shot -- I had great success using DDD to create graphs of the complex data structures.

Alex Jordan
A: 

On the heavy-weight side of things, there is the software reengineering collection called Moose. It has everything you need for this. But it is a large set of separate tools (developed by students mostly), with a varying level of maturity and ease-of-use.

http://moose.unibe.ch/

Stephan Eggermont
A: 

Other tools to visualize data in Java: prefuse and Processing.

Aaron Digulla