addBatch method cause Java heap memory char array grows too fast
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
Hi @wangbing505
- What is the ClickHouse jdbc version do you use?
- Is it a requirement to use JDBC?
Hi @chernser
- ClickHouse jdbc version is 0.2.6,Can a higher version solve this problem?
- yes,or Is there any other way to write data to clickhouse ?
@wangbing505
- Yes, please, update to the latest 0.7.0 version. I do not see such code in it and everything should work fine.
- 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!
@chernser Thank you for your answer,I will try using them and synchronize the results
@wangbing505 as the issue solved?
@chernser hello, I have been delayed by other things and will try it next week
@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
Need to verify how jdbc-v2 handles it.
We might need to stream big SQL requests like we do with text formats. Will prioritize this work.