Eclipse OMR project provides a reusable Garbage Collector

Dibyendu Majumdar via Digitalmars-d digitalmars-d at puremagic.com
Sat Dec 3 02:29:02 PST 2016


On Saturday, 3 December 2016 at 06:26:22 UTC, Chris Wright wrote:
> On Sat, 03 Dec 2016 02:23:13 +0000, Dibyendu Majumdar wrote:
>> IBM has open sourced the J9 Garbage Collector as part of 
>> Eclipse OMR project. Perhaps D could use this. It is claimed 
>> that the GC implementation is relatively straight forward to 
>> reuse.
>
> That's awesome!
>
> Unfortunately, it looks like incorporating it would take a fair 
> bit of effort, and upstreaming it will not happen. I'm going to 
> take a deeper look this weekend, but it's not looking good so 
> far.
>

I would imagine that some effort is necessary ... but the payoff 
is huge isn't it ? To have a robust GC would change the game for 
D.

> That said, let's look at the API:
>
> omrobjectptr_t OMR_GC_Allocate(OMR_VMThread * omrVMThread, 
> uintptr_t allocationCategory, uintptr_t size, uintptr_t 
> allocateFlags);
>
> omrobjectptr_t OMR_GC_AllocateNoGC(OMR_VMThread * omrVMThread, 
> uintptr_t allocationCategory, uintptr_t size, uintptr_t 
> allocateFlagss);
>
> omr_error_t OMR_GC_SystemCollect(OMR_VMThread* omrVMThread, 
> uint32_t gcCode);
>
> First parameter is a pointer to an OMR thread. I'd have to 
> rewrite core.thread to use OMR's thread system, or maybe I 
> could fake OMR threads with enough effort. That's another 
> barrier.
>

I think all GCs need to interact with threads so there has to be 
some linkage between the thread sub-system and GC.

I saw a slide deck or some docs that explained the requirements 
to use OMR GC. Unfortunately I did not save a link and cannot 
locate this now. I will post a link if I find it again.

It said that the OMR expects objects to be allocated on 8-byte 
aligned memory and it requires one GC byte - which is assumed to 
be at the start of the allocated object but can be changed if 
required.

Regards
Dibyendu



More information about the Digitalmars-d mailing list