Where do references to Java objects actually exist?
In memory. Either in the heap, or on a thread stack, or (in some circumstances) in other locations that the JVM knows about. Always in memory.
Strong references are not recycled during garbage collection.
Erm ... not sure what you are really saying here. References are not reclaimed by the GC because they are always held as part of something else.
The hprof file appears to record the connections between objects.
It does.
Where do they exist in the JVM.
The connections are references. If object a
has a reference to object b
in one of its instance variables, then a
will show up as "connected" to b
in the hprof file.
But note that the hprof file is a file. Its not memory. It is produced by the JVM examining all of its live memory locations, and producing a snapshot of the objects.
I guess there's code to maintain it, too?
There is code that creates the hprof file. It is part of the JVM.
Does it have anything to do with object headers?
Well sort of. The code that generates the hprof file understands object headers.
Where do the actual references exist?
In memory; see above.
If not, where did the hprof file come from?
The hprof file is written by the JVM or by a tool that talks to the JVM. (I am not 100% sure which, but it doesn't really matter.)