From ba364e1f1575ad886dbd9d30767f9a008f60a7c5 Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Fri, 10 Mar 2023 19:22:31 -0600 Subject: [PATCH] Add note about garbage collection on PyPy --- guide/src/class/protocols.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/guide/src/class/protocols.md b/guide/src/class/protocols.md index 5f22c157902..3f3cc769f3d 100644 --- a/guide/src/class/protocols.md +++ b/guide/src/class/protocols.md @@ -407,6 +407,8 @@ impl ClassWithGCSupport { } ``` +> Note: these methods are part of the C API, PyPy does not necessarily honor them. If you are building for PyPy you should measure memory consumption to make sure you do not have runaway memory growth. See [this issue on the PyPy bug tracker](https://foss.heptapod.net/pypy/pypy/-/issues/3899). + [`IterNextOutput`]: {{#PYO3_DOCS_URL}}/pyo3/class/iter/enum.IterNextOutput.html [`PySequence`]: {{#PYO3_DOCS_URL}}/pyo3/types/struct.PySequence.html [`CompareOp::matches`]: {{#PYO3_DOCS_URL}}/pyo3/pyclass/enum.CompareOp.html#method.matches