I have a design for a GC algorithm that I would like to implement for a JVM, to allow benchmarking.
Does anyone have any experience as to which implementation would allow the easy hacking, but which still has a built in GC that would make for a meaningful comparison?
Edited: I want a JVM that has garbage collection, as I want to collect stats using it, then rip out their GC, put my own in, and the compare. I want it to have a good GC, as otherwise the comparison is meaning, but I want something with code that is not too difficult to work with (HotSpot has a lot of assembler, making the task more difficult)
So if we pass our app's process id, we can see that this JVM instance is using Serial GC: // ZGC # Java VM: OpenJDK 64-Bit Server VM (15+36-1562, mixed mode, sharing, tiered, z gc, bsd-amd64) // G1GC # Java VM: OpenJDK 64-Bit Server VM (15+36-1562, mixed mode, sharing, tiered, compressed oops, g1 gc, bsd-amd64)
Finding the JVM Process To find the GC used by a JVM process, first, we should identify the process id of that particular JVM instance. Let's say that we ran our app with the following command: If we have JDK installed, the best way to find the process id of JVM instances is to use the jps tool. For instance:
Introduction The JVM ships with various options for garbage collection to support a variety of deployment options. With this, we get flexibility in choosing which garbage collector to use for our application. By default, the JVM chooses the most appropriate garbage collector based on the class of the host computer.
Choosing a GC Algorithm in Java. 1 3.1. Heap Size. This is the total amount of working memory allocated by the OS to the JVM. Theoretically, the larger the memory, the more objects can ... 2 3.2. Application Data Set Size. 3 3.3. Number of CPUs. 4 3.4. Pause Time. 5 3.5. Throughput. More items
I think that the Maxine Research VM from Oracle Labs would be a perfect match for your needs.
Quote from the first page of their wiki:
Project Overview
In this era of modern, managed languages we demand ever more from our virtual machines: better performance, more scalability, and support for the latest new languages. Research and experimentation is essential but no longer practical in the context of mature, complex, production VMs written in multiple languages.
The Maxine VM is a next generation platform that establishes a new standard of productivity in this area of research. It is written entirely in Java, completely compatible with modern Java IDEs and the standard JDK, features a modular architecture that permits alternate implementations of subsystems such as GC and compilation to be plugged in, and is accompanied by a dedicated development tool (the Maxine Inspector) for debugging and visualizing nearly every aspect of the VM's runtime state.
Here's an excelent video demonstrating its memory monitoring utilities:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With