Help, My Java Object Vanished (and the GC Is Not at Fault)

https://arraying.de/posts/markword/

Comments

mandsDec 2, 2025, 12:22 AM
Great read, both in terms of content, but also the approach to diagnosing the issue and debugging in general.
cluckindanDec 1, 2025, 10:48 PM
Check your code block CSS, the font sizes are all over the place on mobile (iOS).

By ”you” I mean anyone who has a blog and uses code blocks.

ErikCorryNov 29, 2025, 1:46 PM
Nice!

Why malloc? Surely this is an on-heap object, not malloc allocated?

tialaramexDec 2, 2025, 1:33 AM
I think you've got yourself confused. The heap is what malloc is allocating. So it's like you said "Surely this is somewhere in Europe, not France?" or "Surely this is a round shape, not a circle?"
comexDec 2, 2025, 4:17 AM
Not when we’re talking about a JVM, which has its own heap that does not use malloc.
tialaramexDec 2, 2025, 12:10 PM
The JVM is of course just software. In this case it's mostly software written in C++ and that software allocates "its own heap" using uh... malloc

https://github.com/openjdk/jdk/blob/master/src/hotspot/share...

pjmlpDec 5, 2025, 8:08 AM
In the specific case of the OpenJDK, there isn't the one JVM, rather a standard[0], like in ISO languages, with a reference implementation to go along it,

https://en.wikipedia.org/wiki/List_of_Java_virtual_machines

And the list doesn't include all, e.g. PTC (https://www.ptc.com/en/products/developer-tools/perc)

[0] - https://docs.oracle.com/javase/specs/index.html

1718627440Dec 5, 2025, 2:00 PM
malloc is also not a specific implementation, but a standardized interface for allocating on the heap.