qiaojialin opened a new issue #2625:
URL: https://github.com/apache/iotdb/issues/2625
version 0.11.2:
When reusing IoTDBConnection to create IoTDBStatement. The statement set in
sessionId2statementId2 is never removed unless the connection is closed.
This will cause OOM if using a Connection is used for too long time.
Reproduce: This may take a long time to OOM...
```
package org.apache.iotdb;
import org.apache.iotdb.jdbc.IoTDBSQLException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
public class JDBCExample {
public static void main(String[] args) throws ClassNotFoundException,
SQLException {
Class.forName("org.apache.iotdb.jdbc.IoTDBDriver");
try (Connection connection =
DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
) {
while (true) {
Statement statement = connection.createStatement();
statement.close();
}
} catch (IoTDBSQLException e) {
System.out.println(e.getMessage());
}
}
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]