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

addBatch method cause Java heap memory char array grows too fast #1873

Open
wangbing505 opened this issue Oct 18, 2024 · 7 comments
Open

addBatch method cause Java heap memory char array grows too fast #1873

wangbing505 opened this issue Oct 18, 2024 · 7 comments
Labels

Comments

@wangbing505
Copy link

wangbing505 commented Oct 18, 2024

image
The scenario involves a large number of calls to the addBatch method, Then use jmap to view heap memory,has lots of char[],although they are all unreachable objects that can be GC dropped.But it will lead to frequent GC and high CPU usage. How to solve it

@chernser chernser added bug module-jdbc JDBC driver question and removed bug labels Oct 21, 2024
@chernser
Copy link
Contributor

Hi @wangbing505

  • What is the ClickHouse jdbc version do you use?
  • Is it a requirement to use JDBC?

@wangbing505
Copy link
Author

Hi @chernser

  1. ClickHouse jdbc version is 0.2.6,Can a higher version solve this problem?
  2. yes,or Is there any other way to write data to clickhouse ?

@chernser
Copy link
Contributor

@wangbing505

  1. Yes, please, update to the latest 0.7.0 version. I do not see such code in it and everything should work fine.
  2. Yes, you may use java client without JDBC - https://clickhouse.com/docs/en/integrations/java/client-v2

Please let me know how the update goes. Thanks!

@wangbing505
Copy link
Author

@chernser
Thank you for your answer,I will try using them and synchronize the results

@chernser
Copy link
Contributor

chernser commented Nov 4, 2024

@wangbing505 as the issue solved?

@wangbing505
Copy link
Author

@chernser hello, I have been delayed by other things and will try it next week

@wangbing505
Copy link
Author

@chernser Thank you, I tried it, Char [] has decreased,But there are other memory uses as well,maybe it's not a problem with the client anymore

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

No branches or pull requests

2 participants