Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Referring to the current stack-frame creates unnecessary reference cycles #2149

Closed
bdbaddog opened this issue Jan 2, 2018 · 0 comments
Closed

Comments

@bdbaddog
Copy link
Contributor

bdbaddog commented Jan 2, 2018

This issue was originally created at: 2008-07-24 09:46:07.
This issue was reported by: pankrat.
pankrat said at 2008-07-24 09:46:08

This patch avoids creating unnecessary reference cycles. SCons throws a
division-by-zero exception to get access and walk the parent stack-frames. This
is no problem as long as the current stack-frame isn't referred to by a local
variable.

Empirical observations indicate that approximately half of the objects involved
in reference cycles and collected by the garbage collector are held because of
those frame objects. This can be easily avoided by starting the iteration with
the parent stack-frame, instead of the own stack-frame.

I believe this to be a zero-cost patch without the need for additional
documentation or tests.

For example, here is the summary of the Heapmonitor Garbage tracker for an
up-to-date check of Ardour:

Without the patch:

$ scons --debug=garbage
...
Garbage: 194515 collected objects ( 89319 in cycles): 66.95 MB

With the patch applied:

$ scons --debug=garbage
...
Garbage: 100536 collected objects ( 23987 in cycles): 36.85 MB

Further discussions of reference cycles can be found in:
http://www.scons.org/wiki/LudwigHaehne/ReferenceCycles

pankrat said at 2008-07-24 09:47:22

Created an attachment (id=454)
Proposed patch avoiding frame reference cycles

gregnoel said at 2008-07-29 06:09:40

Bug party triage.

gregnoel said at 2008-09-09 14:55:18

Bug party triage. Go for it.

pankrat said at 2008-09-10 09:25:15

Fixed in r3383.

More information about this issue is at http://www.scons.org/wiki/LudwigHaehne/ReferenceCycles.

pankrat attached leak_frame.patch at 2008-07-24 09:47:21.

Proposed patch avoiding frame reference cycles

@bdbaddog bdbaddog added this to the 1.1 milestone Jan 2, 2018
@bdbaddog bdbaddog closed this as completed Jan 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant