[master] RFR: Use hashtable for obj->edge mapping in JFR, instead of mark-word

Aleksey Shipilev shade at openjdk.java.net
Tue Oct 12 12:53:24 UTC 2021


On Tue, 12 Oct 2021 11:49:27 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

> JFR overrides the mark-word to (temporarily) store a mapping from object to Edge*. This disturbs the Klass* that we need while tracing for leaks and for later emitting object information. Let's use a hashtable for this, instead, and leave the upper half of the mark-word alone. (The lower half is still used for marking.)
> 
> Testing:
>  - [x] tier1
>  - [x] tier2
>  - [x] jdk/jfr (together with #17 most tests pass, needs one more follow-up test fix)

Looks fine, I have only a few suggestions.

src/hotspot/share/jfr/leakprofiler/chains/edgeStore.cpp line 41:

> 39: EdgeStore::EdgeStore() : _edges(NULL) {
> 40:   _edges = new EdgeHashTable(this);
> 41:   _objEdgeHashTable = new ObjEdgeHashTable();

Not sure why upstream code has `_edges(NULL)` in the initialization list, it feels that `_objEdgeHashTable(NULL)` should be there as well.

src/hotspot/share/jfr/leakprofiler/chains/edgeStore.hpp line 63:

> 61: private:
> 62:   oop _obj;
> 63:   Edge* _edge;

Should be `const`, I think.

-------------

Marked as reviewed by shade (Committer).

PR: https://git.openjdk.java.net/lilliput/pull/18


More information about the lilliput-dev mailing list