minio / minio-py

MinIO Client SDK for Python
https://docs.min.io/docs/python-client-quickstart-guide.html
Apache License 2.0
822 stars 318 forks source link

Memory leak when use fget_object function #1426

Closed Hieu-github closed 2 months ago

Hieu-github commented 2 months ago

I am using fget_object function to download a list file in Minio Server. But the monitor show me something strange image

The memory increases over time.

I try debug with Memory_profiler module and the result are in the image below image

Enviroment:

balamurugana commented 2 months ago

I see 0.3MiB increment in the profile output. Are you referring as memory leak?

Hieu-github commented 2 months ago

@balamurugana yes. And in the next call, the memory is not release 0.3MiB.

balamurugana commented 2 months ago

It could be http client connection pool thing. Use get_object() and handle file download your own. Check the memory usage on the process.

Hieu-github commented 2 months ago

When I use get_object() func. the result is image I realized that The code doesn't seem to fully reclaim the memory allocated to the response stream.

balamurugana commented 2 months ago

It is urllib3 connection pool thing. Pass your own pool manager to Minio class for optimization.