Skip to content

Commit

Permalink
#928: Do not record live object samples between JFR chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
apangin committed May 11, 2024
1 parent b96d09a commit ed7d848
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/flightRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ class Recording {
_start_ticks = TSC::ticks();
_base_id = 0;
_bytes_written = 0;
_memfd = -1;
_in_memory = false;

_chunk_size = args._chunk_size <= 0 ? MAX_JLONG : (args._chunk_size < 262144 ? 262144 : args._chunk_size);
Expand Down
4 changes: 3 additions & 1 deletion src/objectSampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ void ObjectSampler::recordAllocation(jvmtiEnv* jvmti, JNIEnv* jni, EventType eve

if (_live) {
u64 trace = Profiler::instance()->recordSample(NULL, 0, event_type, &event);
live_refs.add(jni, object, size, trace);
if (trace != 0) {
live_refs.add(jni, object, size, trace);
}
} else {
Profiler::instance()->recordSample(NULL, event._total_size, event_type, &event);
}
Expand Down

0 comments on commit ed7d848

Please sign in to comment.