Closed redeyed-13 closed 2 years ago
You should attach a profiler or take a heap dump and identify what is consuming the memory thus causing the OutOfMemoryException. It is very unlikely to be caused by HikariCP.
You can have java automatically create a heap dump file for you by adding this option to the java command line: -XX:+HeapDumpOnOutOfMemoryError
If after doing this you can identify HikariCP as being the cause, please reopen this ticket with the details of what objects were leaked and causing the memory issue.
The main problem is that "java.lang.OutOfMemoryError: unable to create new native thread" is temporary (it corresponds to similar messages in the log
[warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached
), but after this the connection in the pool remains "Active" forever. And within a short period of time, all available connections in the pool may be exhausted.
Is it possible that the exception "java.lang.OutOfMemoryError: unable to create new native thread" in
...
com.zaxxer.hikari.pool.PoolBase.isConnectionAlive(PoolBase.java:16)
com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:186))
...
did not cause the connection to hang in Active-status? Thanks in advance.
Additional Information: hikariCP: 5.0.1 openjdk: 11.0.20 ojdbc8: 19.8.0
P.S. Fix: https://bugs.openjdk.org/browse/JDK-8268773 did not solve the problem completely.
after replacing an old version of hibernate and C3P0 with Hibernate 5.6.4-Final and HikariCP 4.0.3 this exception is killing us:
in addition to the connection parameters, we have specified only these parameters: hibernate.hikari.autoCommit=false hibernate.hikari.maximumPoolSize=10 hibernate.hikari.idleTimeout=600000 hibernate.hikari.leakDetectionThreshold=15000
Any idea? Thanks in advance.