You can iterate the heap space using
jvmtiError
IterateThroughHeap(jvmtiEnv* env,
jint heap_filter,
jclass klass,
const jvmtiHeapCallbacks* callbacks,
const void* user_data)
http://docs.oracle.com/javase/7/docs/platform/jvmti/jvmti.html#IterateThroughHeap