Skip to content

bdb holds the reference to the enter frame unnecessarily long #128991

Closed
@gaogaotiantian

Description

@gaogaotiantian

Feature or enhancement

Proposal:

bdb records the frame that enters the debugger as a utility. However, that could potentially cause a temporary refleak. It will probably clean up eventually, but a temp leak on a frame object is expensive - it links to all the caller frames and their local variables.

I did an attempt in #128190, but it's not perfect. There are two major issues:

  1. The reference will only be released when the debugger is detached (when the user does a continue and there's no breakpoint). In many cases, the reference could be hold for a long time, but it's something that's only needed on the particular callback.
  2. Because of 1., in 3.12, where there are multiple pdb instances created for different inline-breakpoints, the reference could still be leaked (because we did continue in a different pdb instance).

I will refactor the code a bit so the reference to enter frame will always be released before the debugger callback is finished.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions