MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / recordAllocation

Method recordAllocation

src/objectSampler.cpp:145–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145void ObjectSampler::recordAllocation(jvmtiEnv* jvmti, JNIEnv* jni, EventType event_type,
146 jobject object, jclass object_klass, jlong size) {
147 AllocEvent event;
148 event._start_time = TSC::ticks();
149 event._total_size = size > _interval ? size : _interval;
150 event._instance_size = size;
151 event._class_id = lookupClassId(jvmti, object_klass);
152
153 u64 trace = Profiler::instance()->recordSample(NULL, event._total_size, event_type, &event);
154 if (_live && trace != 0) {
155 live_refs.add(jni, object, size, trace);
156 }
157}
158
159void ObjectSampler::initLiveRefs(bool live) {
160 _live = live;

Callers

nothing calls this directly

Calls 3

lookupClassIdFunction · 0.85
recordSampleMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected