From 7bfd80eb74096fc09aafa086efc6f05779ccb710 Mon Sep 17 00:00:00 2001 From: Lokesh Gidra Date: Mon, 13 Nov 2023 21:39:26 +0000 Subject: Initialialize jhp's 'enabled_' field Otherwise, with jemalloc, which doesn't memset(0), we wrongly enable the sampler, which makes allocations slower due to smaller TLABs. Also move IsEnabled() to the header file as it is invoked quite a few times while allocating TLAB. Bug: 310655393 Test: manual testing on devices using jemalloc Change-Id: I63e819488fb980db95080fa17400712bd8efdbe5 --- runtime/javaheapprof/javaheapsampler.cc | 4 ---- 1 file changed, 4 deletions(-) (limited to 'runtime/javaheapprof/javaheapsampler.cc') diff --git a/runtime/javaheapprof/javaheapsampler.cc b/runtime/javaheapprof/javaheapsampler.cc index a73ed0b719..74671347c7 100644 --- a/runtime/javaheapprof/javaheapsampler.cc +++ b/runtime/javaheapprof/javaheapsampler.cc @@ -131,10 +131,6 @@ void HeapSampler::AdjustSampleOffset(size_t adjustment) { << " next_bytes_until_sample = " << next_bytes_until_sample; } -bool HeapSampler::IsEnabled() { - return enabled_.load(std::memory_order_acquire); -} - int HeapSampler::GetSamplingInterval() { return p_sampling_interval_.load(std::memory_order_acquire); } -- cgit v1.2.3-59-g8ed1b