Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which JVM to choose for GC hacking?

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)

like image 929
cjdk Avatar asked Sep 09 '11 20:09

cjdk


People also ask

Which JVM instance is using ZGC or g1gc?

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)

How do I find the GC used by a JVM process?

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:

How does the JVM choose which garbage collector to use?

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.

How to choose the right GC algorithm in Java?

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


1 Answers

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:

  • Introduction to the Maxine Inspector
like image 106
aioobe Avatar answered Sep 24 '22 01:09

aioobe