This commit is contained in:
zyyang 2021-01-06 15:35:44 +08:00
parent c91bfcf4d1
commit 1e8a3a2ead
1 changed files with 1 additions and 12 deletions

View File

@ -19,7 +19,7 @@ public class AppMemoryLeakTest {
} }
} }
@Test(expected = OutOfMemoryError.class) @Test
public void testCreateTooManyStatement() throws ClassNotFoundException, SQLException { public void testCreateTooManyStatement() throws ClassNotFoundException, SQLException {
Class.forName("com.taosdata.jdbc.TSDBDriver"); Class.forName("com.taosdata.jdbc.TSDBDriver");
int stmtCnt = 0; int stmtCnt = 0;
@ -30,15 +30,4 @@ public class AppMemoryLeakTest {
} }
} }
public static void main(String[] args) throws ClassNotFoundException, SQLException {
Class.forName("com.taosdata.jdbc.TSDBDriver");
int stmtCnt = 0;
Connection conn = DriverManager.getConnection("jdbc:TAOS://localhost:6030/?user=root&password=taosdata");
while (true) {
Statement stmt = conn.createStatement();
System.out.println(++stmtCnt + " : " + stmt);
}
}
} }