baztian/jaydebeapi

Memory Leak Issue in Jaydebeapi Python Package

Yeyan-wzq opened this issue · 3 comments

I have encountered a severe memory leak issue while using the Jaydebeapi Python package. Even after closing the cursor and connection, the program's memory usage does not decrease, and it continues to increase with each use of the package. After multiple uses, the program's memory usage reached half of the system's total memory, and only closing the program released the memory.

Upon investigation, I found that there is a memory leak in the data conversion process in the init file of Jaydebeapi, especially when using the getObject function. This issue is causing significant performance problems and memory usage in my application.

Steps to Reproduce:

Open a connection using Jaydebeapi package.
Execute SQL queries and fetch data using the cursor.
Close the cursor and connection.
Repeat the above steps multiple times.
Monitor the program's memory usage.
Expected Results:
The program's memory usage should not increase significantly with each use of the Jaydebeapi package, and closing the cursor and connection should release the memory.

Actual Results:
The program's memory usage continues to increase with each use of the Jaydebeapi package, and closing the cursor and connection does not release the memory.

Additional Information:
The issue is primarily occurring in the data conversion process in the init file of Jaydebeapi, especially when using the getObject function. I would appreciate any guidance or updates on how to resolve this problem, as it is significantly impacting the performance and memory usage of my application. Thank you for your attention to this matter.

I confirm I have that problem too. I have to migrate a huge database, it is almost impossible because it uses too much RAM, even by closing/recreating cursor or connection.

Niivii commented

Confirming too,

Seems to be triggered by _java_to_py(java_method) method in my case and especially .getObject() as stated before.

Hello jaydebapi maintainers, I need help from your end.

Im facing an issue regarding memory and my program is terminating automatically in the case when im fetching the data from the database usig chunk size in scheduled manner as a linux service.

  1. For first some cycles its working here frequently the merory usage is increasing linearly.
  2. Even thought i reduced the chuck size still its casing the same issue.

Can anyone please provide resolution:

  1. How to stop memory usage ?
  2. Is there any soultion in the jaydebapi where i can provide arguments in the execute query which helps to stop this kind of issue.

Tried solutions:

  1. chnaged the chunk size.
  2. closing the curose connection.
  3. Tried to increase heap memory of Java.