Skip to content

Commit 27f7d0a

Browse files
authored
Merge pull request #4085 from DataDog/ivoanjo/prof-9470-enable-heap-clean-after-gc-default
[PROF-9470] Enable "heap clean after GC" profiler optimization by default
2 parents f679de4 + da099a9 commit 27f7d0a

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

.gitlab/benchmarks.yml

-10
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,6 @@ only-profiling-heap:
104104
DD_PROFILING_EXPERIMENTAL_HEAP_ENABLED: "true"
105105
ADD_TO_GEMFILE: "gem 'datadog', github: 'datadog/dd-trace-rb', ref: '$CI_COMMIT_SHA'"
106106

107-
only-profiling-heap-clean-after-gc:
108-
extends: .benchmarks
109-
variables:
110-
DD_BENCHMARKS_CONFIGURATION: only-profiling
111-
DD_PROFILING_ENABLED: "true"
112-
DD_PROFILING_ALLOCATION_ENABLED: "true"
113-
DD_PROFILING_EXPERIMENTAL_HEAP_ENABLED: "true"
114-
DD_PROFILING_HEAP_CLEAN_AFTER_GC_ENABLED: "true"
115-
ADD_TO_GEMFILE: "gem 'datadog', github: 'datadog/dd-trace-rb', ref: '$CI_COMMIT_SHA'"
116-
117107
only-profiling-gvl:
118108
extends: .benchmarks
119109
variables:

lib/datadog/core/configuration/settings.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -518,13 +518,13 @@ def initialize(*_)
518518
# Controls if the heap profiler should attempt to clean young objects after GC, rather than just at
519519
# serialization time. This lowers memory usage and high percentile latency.
520520
#
521-
# Only takes effect when used together with `gc_enabled: true` and `experimental_heap_enabled: true`.
521+
# Only has effect when used together with `gc_enabled: true` and `experimental_heap_enabled: true`.
522522
#
523-
# @default false
523+
# @default true
524524
option :heap_clean_after_gc_enabled do |o|
525525
o.type :bool
526526
o.env 'DD_PROFILING_HEAP_CLEAN_AFTER_GC_ENABLED'
527-
o.default false
527+
o.default true
528528
end
529529
end
530530

spec/datadog/core/configuration/settings_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@
932932
context 'is not defined' do
933933
let(:environment) { nil }
934934

935-
it { is_expected.to be false }
935+
it { is_expected.to be true }
936936
end
937937

938938
[true, false].each do |value|
@@ -947,10 +947,10 @@
947947

948948
describe '#heap_clean_after_gc_enabled=' do
949949
it 'updates the #heap_clean_after_gc_enabled setting' do
950-
expect { settings.profiling.advanced.heap_clean_after_gc_enabled = true }
950+
expect { settings.profiling.advanced.heap_clean_after_gc_enabled = false }
951951
.to change { settings.profiling.advanced.heap_clean_after_gc_enabled }
952-
.from(false)
953-
.to(true)
952+
.from(true)
953+
.to(false)
954954
end
955955
end
956956

0 commit comments

Comments
 (0)