--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp Thu Aug 29 14:05:01 2019 +0200
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp Thu Aug 29 15:16:13 2019 +0200
@@ -345,10 +345,17 @@
}
};
+static bool written = false;
+
static void tag_old_stack_traces(ObjectSample* last_resolved, JfrStackTraceRepository& stack_trace_repo) {
assert(last_resolved != NULL, "invariant");
assert(stack_trace_id_set != NULL, "invariant");
assert(stack_trace_id_set->is_empty(), "invariant");
+ if (written) {
+ // written -> retagged
+ written = false;
+ return;
+ }
StackTraceTagger tagger(stack_trace_repo);
do_samples(last_resolved, NULL, tagger);
}
@@ -529,6 +536,7 @@
return;
}
writer.write_count((u4)sw.count(), count_offset);
+ written = true;
}
void ObjectSampleCheckpoint::write(ObjectSampler* sampler, EdgeStore* edge_store, bool emit_all, Thread* thread) {
--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleWriter.cpp Thu Aug 29 14:05:01 2019 +0200
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleWriter.cpp Thu Aug 29 15:16:13 2019 +0200
@@ -594,7 +594,7 @@
};
class RootType : public JfrSerializer {
-public:
+ public:
void serialize(JfrCheckpointWriter& writer) {
const u4 nof_root_types = OldObjectRoot::_number_of_types;
writer.write_count(nof_root_types);