简体   繁体   中英

OpenJDK: Modifying Java Heap Management

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.

Method InstanceKlass::allocate_instance might be a good entry point for your research. It is calling CollectedHeap::obj_allocate .

http://hg.openjdk.java.net/jdk8/jdk8/hotspot/file/87ee5ee27509/src/share/vm/oops/instanceKlass.cpp#l1096

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM