Embedded JDK how to replace the default allocator

Andrew Haley aph at redhat.com
Sat Dec 12 10:47:17 UTC 2020


On 11/12/2020 20:49, Guy Korland wrote:
> I'm sorry if that is not the right mailing list for such questions, please
> point me to the right one if it's not.
> 
> We're embedding the OpenJDK in a C application, we already managed to make
> it work and run Java bytecode, but we are still missing one last piece, we
> need a way to replace the default memory allocator to use our allocator.
> 
> Is there a way to do it?

Sure. Look in src/hotspot/share/gc/epsilon for an example of the simplest-
possible garbage collector and its interface.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the hotspot-dev mailing list