Reputation: 325
The project that I'm working on is about modification of OpenJdk heap management and garbage collection systems. Currently my main concern is to find the code segments that are responsible for allocating space in heap when a new object is created.
I was wondering if any Java experts can tell me where to start searching.
Any feedback of yours will be greatly appreciated.
Upvotes: 1
Views: 177
Reputation: 12638
It also depends on which garbage collector you want to instrument. I recently worked on the garbage first (G1) GC, whichs main class is located in /share/vm/gc_implementation/g1/g1CollectedHeap
.
You may also want to have a look at our research project AntTracks, which consits of a customized JVM that tracks each object allocation and movement within the JVM and logs it to a trace file which then can be analyzed. Therefore, we also had to instrument each location where the GC allocates an object.
Upvotes: 1
Reputation: 32980
Method InstanceKlass::allocate_instance
might be a good entry point for your research. It is calling CollectedHeap::obj_allocate
.
Upvotes: 2