Modifying the JVM to have a more deterministic garbage collection model

Tony Printezis Antonios.Printezis at sun.com
Mon Nov 3 16:10:01 UTC 2008


Hi there,

How long will you have to do this and how familiar are you with 
modifying JVMs? I don't mean to put you off, but implementing an RC GC 
in HotSpot is not a trivial project. Not only you will have to implement 
the memory management part (maybe the CMS old gen will be a good start 
for this, given that it doesn't compact like all other GCs and RC 
typically requires a non-moving space), but also you will have to modify 
the JVM / interpreter / JIT to change the barriers to maintain the 
reference counts. Modifying the JIT will be tricky (C1, the client JIT, 
will be easier; C2, the server JIT, will be much harded). So, maybe, you 
could do this by turning off the JIT and run interpreter-only. Look at 
the oop_store* methods in oop.hpp to see how to change the barriers in 
the JVM (but I think you'll still need to modify the interpreter).

Good luck. :-)

Tony

mirza2m at gmail.com wrote:
> Hi,
> For my class project I want to modify the JVM to have a more 
> deterministic garbage collection model. I will take a  reference 
> counting approach to accomplish this.  More specifically I will use a 
> variation of  the algorithm described here
>
> http://www.jucs.org/jucs_13_6/cyclic_reference_counting_with/jucs_13_6_0830_0838_lins.pdf 
>
>
> In order to do this I need to store  reference count or multiple 
> reference counts for each object.  I will also need to update these 
> counts when a reference is added or removed. I need some help on 
> figuring out what would be the best way to do this? Can this be done 
> by tweaking or replacing some parts of the jvm or would I have to do 
> an over haul of the whole jvm (I hope that is not the case :) ) I have 
> looked at some of the source code at src/share/vm/{memory, 
> gc-interface, gc-implementation} but seems like this only handles 
> garbage collection it self, I also wanted to know where I would put 
> hooks to update refrence counts and what would be the best place to 
> store the reference counts, with in the object itself or somewhere 
> else. Any suggestion on software engineering aspect of this project 
> would also be very helpful.
>
>
> Thank you 

-- 
----------------------------------------------------------------------
| Tony Printezis, Staff Engineer    | Sun Microsystems Inc.          |
|                                   | MS BUR02-311                   |
| e-mail: tony.printezis at sun.com    | 35 Network Drive               |
| office: +1 781 442 0998 (x20998)  | Burlington, MA01803-0902, USA  |
----------------------------------------------------------------------
e-mail client: Thunderbird (Solaris)





More information about the hotspot-gc-dev mailing list