O؇HN6j d Z ddlmZ ddlZddlZddlZddlZddlZddlZddlm Z ddlm
Z
ddlmZ ddlmZ ddlm
Z
dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm!Z! ddlm"Z" ddlm#Z# ddlm$Z$ ddlm%Z% ddlm&Z& ej' j( Z( ej) Z*d Z+d! Z, G d" d#e Z- G d$ d%e- Z. ej/ e d& G d' d(e Z0 G d) d*e Z1e2d+k rdd,l3m4Z4 e4e5 dS dS )-a
Tests for detecting function memory leaks (typically the ones
implemented in C). It does so by calling a function many times and
checking whether process memory usage keeps increasing between
calls or over time.
Note that this may produce false positives (especially on Windows
for some reason).
PyPy appears to be completely unstable for this framework, probably
because of how its JIT handles memory, so tests are skipped.
)print_functionN)LINUX)MACOS)OPENBSD)POSIX)SUNOS)WINDOWS)ProcessLookupError)super)HAS_CPU_AFFINITY)HAS_CPU_FREQ)HAS_ENVIRON)
HAS_IONICE)HAS_MEMORY_MAPS)HAS_NET_IO_COUNTERS)HAS_PROC_CPU_NUM)HAS_PROC_IO_COUNTERS)
HAS_RLIMIT)HAS_SENSORS_BATTERY)HAS_SENSORS_FANS)HAS_SENSORS_TEMPERATURES)TestMemoryLeak)create_sockets)
get_testfn)process_namespace)skip_on_access_denied)spawn_testproc)system_namespace) terminate c d } | S )zsDecorator for those Linux functions which are implemented in pure
Python, and which we want to run faster.
c F t j fd }|S )Nc t rG| j j } t | j _ | g|R i ||| j _ S # || j _ w xY w | g|R i |S N)r __class__times FEW_TIMES)selfargskwargsbeforefuns n/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib64/python3.11/site-packages/psutil/tests/test_memleaks.pywrapperz5fewtimes_if_linux.