# Improving Ansible performance by hinting the Python GC about unreachable cycles

**URL:** <https://forum.ansible.com/t/improving-ansible-performance-by-hinting-the-python-gc-about-unreachable-cycles/46157>\
**Category:** Project Discussions\
**Tags:** cloud\
**Created:** [August 11, 2026, 9:56am UTC](https://forum.ansible.com/t/improving-ansible-performance-by-hinting-the-python-gc-about-unreachable-cycles/46157 "2026-08-11T09:56:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![omripalmon](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/omripalmon/32/11027_2.png) [@omripalmon](https://forum.ansible.com/u/omripalmon)\
**Post date:** [August 11, 2026, 9:56am UTC](https://forum.ansible.com/t/improving-ansible-performance-by-hinting-the-python-gc-about-unreachable-cycles/46157/1 "2026-08-11T09:56:17Z")

</div>

I have recently tried to convince the Python community to add a feature to the Python GC which would accept hints that a certain group of objects is unreachable and can be deallocated. Such a feature would reduce the amount of time spent in full memory scan and improve P99 latency. The actual hints can be provided by developers or Claude Code.

See [Improving Python Garbage Collection Performance by Providing Unreachable Cycles Hints - Ideas - Discussions on Python.org](https://discuss.python.org/t/improving-python-garbage-collection-performance-by-providing-unreachable-cycles-hints/108307) for more details.

I need to test this first on a large scale complex Python environment, and Ansible seems perfect for this. Can anyone from the Ansible team with me on this? I can code the feature, but I will need a real-life environment to see the actual performance gain. If we can show definite improvement we can use it to push this feature to the Python team.
