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 Issue in Jaydebeapi Python Package #227

Open
Yeyan-wzq opened this issue Mar 5, 2023 · 3 comments
Open

Memory Leak Issue in Jaydebeapi Python Package #227

Yeyan-wzq opened this issue Mar 5, 2023 · 3 comments

Comments

@Yeyan-wzq
Copy link

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.

@elapouya
Copy link

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
Copy link

Niivii commented Jun 13, 2023

Confirming too,

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

@sairam6267
Copy link

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.

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

4 participants