Skip to content

Conversation

@nsrip-dd
Copy link
Contributor

@nsrip-dd nsrip-dd commented Sep 3, 2025

In #14205 we removed the _interval parameter for the MemoryCollector.
This was a mistake. Now the memory profile collector thread basically
spins in a tight loop because the interval is 0. Add that parameter
back.

Backports #14276 to the 3.12 branch. This was fixed in 3.12.0 but
somehow didn't make it to 3.12.1 or 3.12.2

The actual fix was picked up by #14487 and this PR is mainly to add a release note.

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

@nsrip-dd nsrip-dd requested a review from a team as a code owner September 3, 2025 14:16
@taegyunkim taegyunkim added the changelog/no-changelog A changelog entry is not required for this PR. label Sep 3, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2025

CODEOWNERS have been resolved as:

releasenotes/notes/profiling-fix-memalloc-collector-spin-regression-97b4b8093a89c54f.yaml  @DataDog/apm-python

@taegyunkim taegyunkim enabled auto-merge (squash) September 3, 2025 14:17
@taegyunkim taegyunkim disabled auto-merge September 3, 2025 14:18
@taegyunkim taegyunkim removed the changelog/no-changelog A changelog entry is not required for this PR. label Sep 3, 2025
@nsrip-dd nsrip-dd changed the title chore(profiling): re-accept interval for memory profile collector [backport 3.12] fix(profiling): re-accept interval for memory profile collector [backport 3.12] Sep 3, 2025
…ckport 3.12]

In #14205 we removed the `_interval` parameter for the
`MemoryCollector`.
This was a mistake. Now the memory profile collector thread basically
spins in a tight loop because the interval is 0. Add that parameter
back.

Backports #14276 to the 3.12 branch. This was fixed in 3.12.0 but
somehow didn't make it to 3.12.1 or 3.12.2
@taegyunkim taegyunkim added the Profiling Continous Profling label Sep 3, 2025
@nsrip-dd nsrip-dd force-pushed the backport-14276-to-3.12 branch from bb070ce to bb57fef Compare September 3, 2025 14:23
@nsrip-dd nsrip-dd requested a review from a team as a code owner September 3, 2025 14:23
@nsrip-dd nsrip-dd enabled auto-merge (squash) September 3, 2025 14:25
@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 280 ± 6 ms.

The average import time from base is: 281 ± 6 ms.

The import time difference between this PR and base is: -0.4 ± 0.3 ms.

The difference is not statistically significant (z = -1.27).

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 1.919 ms (0.68%)
ddtrace.bootstrap.sitecustomize 1.246 ms (0.44%)
ddtrace.bootstrap.preload 1.246 ms (0.44%)
ddtrace.internal.remoteconfig.client 0.626 ms (0.22%)
ddtrace 0.673 ms (0.24%)
ddtrace.internal._unpatched 0.026 ms (0.01%)
json 0.026 ms (0.01%)
json.decoder 0.026 ms (0.01%)
re 0.026 ms (0.01%)
enum 0.026 ms (0.01%)
types 0.026 ms (0.01%)

@nsrip-dd nsrip-dd disabled auto-merge September 3, 2025 15:20
@erikayasuda erikayasuda merged commit 59627ec into 3.12 Sep 3, 2025
157 of 161 checks passed
@erikayasuda erikayasuda deleted the backport-14276-to-3.12 branch September 3, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Profiling Continous Profling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants