Skip to content

Conversation

@oliver-sanders
Copy link
Member

@oliver-sanders oliver-sanders commented Oct 17, 2025

(low priority)

I've been using the tracemalloc module (stdlib) a lot in recent memory investigations.

This is how I spotted the leak in: #6985

It can be very useful in pinpointing memory changes in situations where the memory is allocated to the callstack rather than being attached to an object. For example, tracemalloc will spot memory accumulated by lru_cache, but this memory isn't associated with the Scheduler object so won't show in pympler plots of Scheduler attributes.

Took my script and dumped it into a main loop plugin. Like the other main loop plugins, this is not imported or run unless requested.

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Tests are included (or explain why tests are not needed).
  • Changelog entry included if this is a change that can affect users - developer feature
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant