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

【强力建议】集算器增加连接池功能 #26

Open
Jetol opened this issue Feb 22, 2023 · 1 comment
Open

【强力建议】集算器增加连接池功能 #26

Jetol opened this issue Feb 22, 2023 · 1 comment

Comments

@Jetol
Copy link

Jetol commented Feb 22, 2023

springboot连接集算器后,每次调用都要打开和关闭;现在我打开之后,先不关闭,导致每次都创建很多连接报内存溢出异常。
4b76b740063b432fddc2eb207f96b4a
分析如下:
b033fc2b7639c410b940d7f31513f15

想期望一次open,等处理完所有批数据后再关闭;

@xuzaoya
Copy link

xuzaoya commented Feb 22, 2023

1、内存溢出跟有没有连接池没啥关系,而且就算是使用连接池,也是每次调用完后close让连接返回连接池,如果一直保持那连接池也没什么意义。
2、Connection和Statement在创建时不占什么资源,但在执行语句时会产生各种对象及其底层的资源(如数据库连接、文件句柄等),这要求你写的脚本里必须将资源释放(经常就是close办法)

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

2 participants