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

Potential memory leak if not reuse cursor #194

Closed
chenaoxd opened this issue Mar 3, 2021 · 0 comments
Closed

Potential memory leak if not reuse cursor #194

chenaoxd opened this issue Mar 3, 2021 · 0 comments

Comments

@chenaoxd
Copy link

chenaoxd commented Mar 3, 2021

Describe the bug

conn = connect('clickhouse://localhost')
while True:
    cursor = conn.cursor()
	cursor.close()

There will be a memory leak here because of this line of code:

self.cursors.append(cursor)

To Reproduce

Run the code above

Expected behavior

cursor should be garbage collected, but it can't be because of this line of code:

self.cursors.append(cursor)

Versions

  • clickhouse-driver==0.2.0
  • Python version: 3.7.5
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