summaryrefslogtreecommitdiffstats
path: root/Doc/lib
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-08-10 17:37:33 (GMT)
committerFred Drake <fdrake@acm.org>2001-08-10 17:37:33 (GMT)
commitd635e3c468d312ce83f6cacc1989dfdc735dbc05 (patch)
treef5fc3bff73ac7a2a3e9a5590951871910c3cfb80 /Doc/lib
parent9b9c972abeed3f2d5fa50a98fed44b51103b3796 (diff)
downloadcpython-d635e3c468d312ce83f6cacc1989dfdc735dbc05.zip
cpython-d635e3c468d312ce83f6cacc1989dfdc735dbc05.tar.gz
cpython-d635e3c468d312ce83f6cacc1989dfdc735dbc05.tar.bz2
Added a warning about reference cycles and memory consumption to the
section on functions which return stack frames. This closes SF bug #449258.
Diffstat (limited to 'Doc/lib')
-rw-r--r--Doc/lib/libinspect.tex10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/lib/libinspect.tex b/Doc/lib/libinspect.tex
index 6101ad8..e5ec9ca 100644
--- a/Doc/lib/libinspect.tex
+++ b/Doc/lib/libinspect.tex
@@ -264,6 +264,16 @@ line within that list.
The optional \var{context} argument specifies the number of lines of
context to return, which are centered around the current line.
+\strong{Warning:} Keeping references to frame objects, as found in
+the first element of the frame records these functions return, can
+cause your program to create reference cycles. Once a reference cycle
+has been created, the lifespan of all objects which can be accessed
+from the objects which form the cycle can become much longer even if
+Python's optional cycle detector is enabled. If such cycles must be
+created, it is important to ensure they are explicitly broken to avoid
+the delayed destruction of objects and increased memory consumption
+which occurs.
+
\begin{funcdesc}{getouterframes}{frame\optional{, context}}
Get a list of frame records for a frame and all higher (calling)
frames.