-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GR-42740] [GR-44248] Experimental support for JFR event streaming. #6146
Conversation
…ed. Will pass tests now
…al and disk writting.
6e39400
to
d4d69ba
Compare
@roberttoyonaga : this is basically your PR with a bunch of changes on top because I ran into larger issues:
There are still a few known issues:
Feel free to review the changes. |
d4d69ba
to
e2da2db
Compare
@@ -723,14 +716,14 @@ protected void operate() { | |||
|
|||
/* No further JFR events are emitted, so free all JFR-related buffers. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment might not be true anymore. We flush all the local buffers to the global buffers, but the java local buffers do not get freed here only retired.
public void teardown() { | ||
JfrBufferNode node = head; | ||
while (node.isNonNull()) { | ||
assert node.getBuffer().isNull(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this assertion and the Javadoc above always true? When destroyJfr
is called and the java buffer node list is being torn down, when are the JfrBuffers freed before reaching here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, this is one of the open topics. I need to think about this a bit more because I don't have a good solution yet.
Hi Christian, thank you for resolving those issues. The new changes seem reasonable to me. I only have a few questions.
But even if there is no flushing, won't the node lists still be traversed during an epoch change, and old nodes cleaned up? |
That is right, I forgot to mention that. The problem is that a lot of time can pass before an epoch change happens (i.e., a lot of threads could start and die in that time). I think this is something that we should address at some point but it isn't super important because it most likely won't cause any issues in practice. |
This is what I was a bit concerned about before, and why I had originally had an eager cleanup scheme where nodes attempt to be removed once their threads die. Do you think we should try to re-implement something similar to that at some time in the future? |
currentConstantPoolPosition += deltaNext; | ||
} while (deltaNext != 0); | ||
|
||
/* Now that we collected all data, verify and clear it. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to check with compareFoundAndExpectedIds()
after each constant pool? This way we can validate each flush individually to make sure there's no unexpected references at any intermediate point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, we can indeed verify the accumulated constant pool data after every checkpoint. I changed this so that the code is now similar to what you had in place before.
Yes, but I think that we can use something simple, like an explicit lock for iterating/removing nodes (instead of relying on the |
70b4847
to
1774ccb
Compare
1774ccb
to
322c36d
Compare
No description provided.