Skip to content

Commit 2ff8906

Browse files
DinoVmeta-codesync[bot]
authored andcommitted
Clear deopt stats on cache clear
Summary: The deopt stats hold a strong reference to the types they're associated with. This causes an apparent memory leak in the ref leak tests. We should clear these when we clear the other caches. Reviewed By: alexmalyshev Differential Revision: D91925708 fbshipit-source-id: 1567a8d8f2a1466ad215b58c77fc9d3b086ea5ca
1 parent 8ed9d82 commit 2ff8906

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

cinderx/_cinderx-lib.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ PyObject* clear_caches(PyObject* mod, PyObject*) {
7070
_PyCheckedDict_ClearCaches();
7171
_PyCheckedList_ClearCaches();
7272
_PyClassLoader_ClearValueCache();
73+
jit::Runtime::get()->clearDeoptStats();
7374
// We replace sys._clear_type_cache with our own function which
7475
// clears the caches, so we should call this too.
7576
if constexpr (PY_VERSION_HEX >= 0x030C0000) {

0 commit comments

Comments
 (0)