Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak during import #90

Open
insani7y opened this issue Oct 12, 2023 · 0 comments
Open

Memory leak during import #90

insani7y opened this issue Oct 12, 2023 · 0 comments

Comments

@insani7y
Copy link

insani7y commented Oct 12, 2023

Long story short

I use aiofile to check health of consumers. Some file is being touched during consumer process and then in k8s liveness probe I compare modified time.
Unfortunately I noticed a memory leak that was caused by liveness probe.

Expected behavior

I expect no memory leaks :)

Actual behavior

There is one.

Steps to reproduce

Here code for reproduction:

# liveness_probe/__main__.py
import asyncio


async def liveness_probe() -> None:
    import aiofile

    aiofile


if __name__ == "__main__":
    asyncio.run(liveness_probe())

Aiofile should be imported inside function.

    livenessProbe:
      initialDelaySeconds: 30
      periodSeconds: 10
      timeoutSeconds: 10
      exec:
        command:
          - python
          - -m
          - liveness_probe

Just probe inside k8s Deployment.

Environment info

k8s version: 1.21.8
aiofile version: 3.8.0 - 3.8.8 (didn't check other)
python version: 3.11.3 - 3.11.6 (didn't check other)

I have been produced this problem with implementations:
✅ export CAIO_IMPL=linux
✅ export CAIO_IMPL=thread
✅ export CAIO_IMPL=python

Additional info

Here are graphs of the increase in the amount of memory consumed in pod:
photo_2023-10-12 16 33 10
photo_2023-10-12 16 33 07

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant