-
Notifications
You must be signed in to change notification settings - Fork 720
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
JTReg Test Failure - serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorVMEventsTest.java #6024
Comments
Another
This test expects |
After a bit digging, it appears
@charliegracie could you shine some lights on this? |
The test is bogus in my opinion. This is a "sample" and in such is not guaranteed to fire an exact number of samples. I will look into what we could do but this should not work on HotSpot either. The JEP talks about a random sample base such that a common application pattern would not always give the same samples. If that was true then this test could never work! We should be pushing back on the test implementation. Sadly as this is a JEP I doubt we will be able to provide any input. |
I will look into what we can do to "improve" the situation but I doubt we will ever have a case where we sample all 400 allocations in the above scenario. |
Here is a quick hack that may do what you want. FYI I have not compiled or tested this code.
|
Also the sampling still only happens on out of line allocates. The above hack forces out of line allocates for all allocations when the sampling threshold is less than maximum TLH size. |
Thanks @charliegracie for your quick response, will give it a try. |
The patch doesn't work as expected because of It appears P.S. |
just because the RI finds all allocations does not mean it is correct re the wording of the specification. Threads are not atomically updated to see the new values as this is a performance nightmare. The proposed changes above rely on async checks to cause the threads to recognize the new values. No JVM, I repeat no JVM, could be expected to have a lightweight allocation monitoring system force threads through an exclusive vm access to update this value. Did the proposed change improve things at all? The inline call you posted in the previous comment may not have anything to do with this since the JIT can inline allocate as well. The only acceptable solution is to wait for the next TLH refresh fo the thread to obey the new threshold. If this can not how the JEP is worded then it is flawed and we should be pushing back on the JEP or its tests. |
There is no observable difference. Allocation and _oolTraceAllocationBytes
So The cause of insufficient sampling event JEP and RI behaviours |
Hmm looking at your test case you are not changing the value of _oolTraceAllocationBytes via the GC API during runtime you are specifying it via the command line. I thought the JVMTI code allowed this value to be changed dynamically at runtime. Does it? My changes above will only have an impact if you call the |
Also you are correct the code currently only accounts for objects allocated ool. It should also be considering TLH refreshes as well. Looking into this now |
The I did test the patch with original |
@JasonFengJ9 is there a JVMTI API for modifying the sampling threshold? |
@charliegracie Is this still something you plan to work on? |
OpenJ9 does not generate sufficient JVMTI sampling object allocation events when the sampling interval is set to zero
This is a JTreg test failure against JEP 331 implementation.
Failure link
N/A - local runs
Optional info
Failure output
Notes:
The failed test code snippet is in [1]. This test sets the sampling interval to
0
, then attempts to allocate400
integer arraysint[1000]
, and expects400
sampling events which is considered as PASS. Repeat this10
times until a pass, otherwise a failure.OpenJ9
seems only generate sampling events12 - 38
for such400
array allocation, which is quite far from the number of events required.I built a standalone testcase TestSampleEverything.zip without
JVMTI
agent, this issue can be demonstrated via following:The expected number of trace output for
object size=4008; number of elements=1000
is close to10 * 400
, i.e.,4000
, but usually just got below400
.[1] https://github.com/ibmruntimes/openj9-openjdk-jdk11/blob/1c55bba834d441d680298c240ac241ec9aa0b668/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java#L164-L188
fyi: @charliegracie @DanHeidinga
The text was updated successfully, but these errors were encountered: