Skip to content

Commit

Permalink
Merge pull request #4085 from DataDog/ivoanjo/prof-9470-enable-heap-c…
Browse files Browse the repository at this point in the history
…lean-after-gc-default

[PROF-9470] Enable "heap clean after GC" profiler optimization by default
  • Loading branch information
ivoanjo authored Nov 7, 2024
2 parents f679de4 + da099a9 commit 27f7d0a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
10 changes: 0 additions & 10 deletions .gitlab/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,6 @@ only-profiling-heap:
DD_PROFILING_EXPERIMENTAL_HEAP_ENABLED: "true"
ADD_TO_GEMFILE: "gem 'datadog', github: 'datadog/dd-trace-rb', ref: '$CI_COMMIT_SHA'"

only-profiling-heap-clean-after-gc:
extends: .benchmarks
variables:
DD_BENCHMARKS_CONFIGURATION: only-profiling
DD_PROFILING_ENABLED: "true"
DD_PROFILING_ALLOCATION_ENABLED: "true"
DD_PROFILING_EXPERIMENTAL_HEAP_ENABLED: "true"
DD_PROFILING_HEAP_CLEAN_AFTER_GC_ENABLED: "true"
ADD_TO_GEMFILE: "gem 'datadog', github: 'datadog/dd-trace-rb', ref: '$CI_COMMIT_SHA'"

only-profiling-gvl:
extends: .benchmarks
variables:
Expand Down
6 changes: 3 additions & 3 deletions lib/datadog/core/configuration/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,13 @@ def initialize(*_)
# Controls if the heap profiler should attempt to clean young objects after GC, rather than just at
# serialization time. This lowers memory usage and high percentile latency.
#
# Only takes effect when used together with `gc_enabled: true` and `experimental_heap_enabled: true`.
# Only has effect when used together with `gc_enabled: true` and `experimental_heap_enabled: true`.
#
# @default false
# @default true
option :heap_clean_after_gc_enabled do |o|
o.type :bool
o.env 'DD_PROFILING_HEAP_CLEAN_AFTER_GC_ENABLED'
o.default false
o.default true
end
end

Expand Down
8 changes: 4 additions & 4 deletions spec/datadog/core/configuration/settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@
context 'is not defined' do
let(:environment) { nil }

it { is_expected.to be false }
it { is_expected.to be true }
end

[true, false].each do |value|
Expand All @@ -947,10 +947,10 @@

describe '#heap_clean_after_gc_enabled=' do
it 'updates the #heap_clean_after_gc_enabled setting' do
expect { settings.profiling.advanced.heap_clean_after_gc_enabled = true }
expect { settings.profiling.advanced.heap_clean_after_gc_enabled = false }
.to change { settings.profiling.advanced.heap_clean_after_gc_enabled }
.from(false)
.to(true)
.from(true)
.to(false)
end
end

Expand Down

0 comments on commit 27f7d0a

Please sign in to comment.