How does something like Graal handle memory when emulating C? I imagine using JVM 1.9 will help?
There are actually three implementations of C on top of Graal/Truffle by now.
TruffleC was the first and it maps malloc to the JVM's Unsafe malloc equivalent. So if you double free you trash the VM basically.
ManagedC ignores calls to free() and garbage collects the C programs heap.
Sulong interprets LLVM bytecode. I don't know how it does memory management.