qiaojialin opened a new issue #2624:
URL: https://github.com/apache/iotdb/issues/2624
version 0.11.2:
When reusing IoTDBStatement to do queries. The Set<queryId> in
statementId2QueryId is never removed unless the statment is clsoed.
This will cause OOM if using a Statement 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.ResultSet;
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");
Statement statement = connection.createStatement()) {
while (true) {
//set JDBC fetchSize
ResultSet resultSet = statement.executeQuery("select * from root");
resultSet.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]