Since jdk6, JDI has some limited heap walking capabilities. If you are looking to build a memory profiler then you probably should be looking at JVM TI:
http://download.java.net/jdk6/docs/platform/jvmti/jvmti.html#Heap
Alternatively, you are looking for a tool to view the objects then jmap utility in jdk6 might be useful. The -histo option will give you a class-wise histogram of the options in the heap, and the -dump option allows you to take a heap dump.