-
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
Support tracing allocation bytes #9254
Conversation
Are the compile errors expected?
|
this PR is is dependent on eclipse-omr/omr#5071 |
d99f303
to
2ab925e
Compare
62f12d9
to
da229de
Compare
@dmitripivkine the code has been changed to disable inline allocation for all of threads if disableInlineAllocationForSamplingBytesGranularity is true. |
6d335c4
to
1b91a23
Compare
code is updated, ready for review. |
@@ -270,7 +271,8 @@ traceObjectCheck(J9VMThread *vmThread) | |||
if(extensions->doOutOfLineAllocationTrace){ | |||
uintptr_t byteGranularity = extensions->oolObjectSamplingBytesGranularity; | |||
|
|||
if(env->_oolTraceAllocationBytes >= byteGranularity){ | |||
/* if we want to trace ool Allocation, use env->_oolTraceAllocationBytes for comparison */ | |||
if(env->_traceAllocationBytes >= byteGranularity){ |
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.
Please correct me if I missed something: We are trying to implement new tracing mode using _traceAllocationBytes
however need to support existing tracing using _oolTraceAllocationBytes
(mutually exclusive cases obviously) sharing oolObjectSamplingBytesGranularity
for sampling interval. If it is a case should we have both checks here (is it possible to combine)? Would existing tracing be broken by this change?
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.
So far I know only health centre use it, I think that using _traceAllocationBytes would help health centre to get more accurate report too, if we want to keep existing tracing, we need to vm side to update to split usage. @JasonFengJ9 any comment?
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.
Also we do increment _oolTraceAllocationBytes
in MM_TLHAllocationInterface::allocateObject()
but can not find any similar place for _traceAllocationBytes
. Where it is incremented?
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.
@dmitripivkine the change at line 206 of MM_TLHAllocationInterface::allocateObject(), the code had merged week ago.
if (NULL != result) {
uintptr_t sizeInBytesAllocated = allocDescription->getContiguousBytes();
/* Increment by bytes allocated */
env->_traceAllocationBytes += sizeInBytesAllocated;
if (!allocDescription->isCompletedFromTlh()) {
#if defined(OMR_GC_OBJECT_ALLOCATION_NOTIFY)
env->objectAllocationNotify((omrobjectptr_t)result);
#endif /* OMR_GC_OBJECT_ALLOCATION_NOTIFY */
_stats._allocationBytes += sizeInBytesAllocated;
_stats._allocationCount += 1;
}
}
env->_oolTraceAllocationBytes += (_stats.bytesAllocated() - _bytesAllocatedBase); /* Increment by bytes allocated */
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.
Thank you. I looked to outdated code, sorry
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.
So far I know only health centre use it, I think that using _traceAllocationBytes would help health centre to get more accurate report too, if we want to keep existing tracing, we need to vm side to update to split usage.
If new feature covers old functionality (do we have tests for it?), it is ok for me to have new one only. I was confused by your change in traceAllocateObject()
where you seems try to maintain both variables (why?)
If it is a case more clearing/renaming is required - should _oolTraceAllocationBytes
be removed and _ool
prefix variables be renamed?
a3d8238
to
3b27fa2
Compare
-Keep env->_oolTraceAllocationBytes and exts->oolObjectSamplingBytesGranularity (default = 16MB, can be changed via jvm option -Xgc:allocationSamplingGranularity=xxx) for triggering tracepoint Trc_MM_J9AllocateIndexableObject_outOfLineObjectAllocation and Trc_MM_J9AllocateObject_outOfLineObjectAllocation, which are used by Health Center -The default of triggering the tracepoints is on, can be enabled/disabled by -Xgc:allocationSamplingEnable/allocationSamplingDisable. -New env->_traceAllocationBytes and ext->objectSamplingBytesGranularity (default = 512KB, can be set by J9MemoryManagerFunction j9gc_set_allocation_sampling_interval()) for triggering jvmti event JVMTI_EVENT_SAMPLED_OBJECT_ALLOC. -The default of triggering jvmti event JVMTI_EVENT_SAMPLED_OBJECT_ALLOC is off, can be enabled/disabled via j9gc_set_allocation_sampling_interval(). Signed-off-by: Lin Hu <linhu@ca.ibm.com>
Udate: New env->_traceAllocationBytes and ext->objectSamplingBytesGranularity |
now tracing allocation bytes supports both tracepoints(Health Center) and JVMTI_EVENT_SAMPLED_OBJECT_ALLOC(JEP331) independently, personal build has passed for local tests, code is ready for review. |
Had a conversation with @LinHu2016 about the performance overhead of this PR. If I understand correctly, here is current state of the implementation:
Considering existing implementation misses most of sampling as per #6024 & #7740, I am leaning toward accepting the intermediate solution which is functional correct, allows users continue the field research work and potentially provides more feedback. @DanHeidinga could you shine some lights on this? |
~10% overhead for a "low overhead" jvmti feature is too high but better to be correct then broken. I'd like to understand the timeline for the better solution |
3 was just a proof of concept that sampling can be done accurately without significant overhead. This is not an intermediate solution. It's just a basis for real solution 2. I estimate about 2wks to get real solution. |
We're coming up on the code split for the v0.20.0 release on June 7th. Is the real solution going to be ready and merged before then? |
Since we switched the implementation to eclipse-omr/omr#5260 this PR became obsolete. |
Keep env->
_oolTraceAllocationBytes
and exts->oolObjectSamplingBytesGranularity
(default = 16MB, can be changedvia jvm option
-Xgc:allocationSamplingGranularity=xxx
)for triggering tracepoint
Trc_MM_J9AllocateIndexableObject_outOfLineObjectAllocation
and
Trc_MM_J9AllocateObject_outOfLineObjectAllocation
, which are used by Health Center.The default of triggering the tracepoints is on, can be enabled/disabled by
-Xgc:allocationSamplingEnable/allocationSamplingDisable
.Allocation bytes for triggering the tracepoints are counted for out of line allocation only.
New env->
_traceAllocationBytes
and ext->objectSamplingBytesGranularity
(default = 512KB, can be set by J9MemoryManagerFunction
j9gc_set_allocation_sampling_interval()
) for triggering jvmti eventJVMTI_EVENT_SAMPLED_OBJECT_ALLOC
.The default of triggering jvmti event
JVMTI_EVENT_SAMPLED_OBJECT_ALLOC
is off, can be enabled/disabled via
j9gc_set_allocation_sampling_interval()
.Allocation bytes for triggering
JVMTI_EVENT_SAMPLED_OBJECT_ALLOC
are counted both inline and out of line allocation.depends on eclipse-omr/omr#5071
Signed-off-by: Lin Hu linhu@ca.ibm.com