[CONJ-1124] OutOfMemoryError when executeUpdate Created: 2023-11-18 Updated: 2023-11-24 Resolved: 2023-11-24 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | Other |
| Affects Version/s: | 3.3.0 |
| Fix Version/s: | 3.3.1 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Wenqian Deng | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MacOS |
||
| Description |
|
The issue occurs when executing a JDBC test case using the MariaDB connector, leading to a java.lang.OutOfMemoryError: Java heap space error.
stack trace: at org.mariadb.jdbc.client.result.StreamingResult.<init>(StreamingResult.java:90) |
| Comments |
| Comment by Wenqian Deng [ 2023-11-18 ] | ||||||||||||
|
Another interesting behavior I found is that if I catch the OutOfMemoryError and execute setTransactionIsolation after it, I get an ArrayIndexOutOfBoundsException
| ||||||||||||
| Comment by Diego Dupin [ 2023-11-22 ] | ||||||||||||
|
This can happen in 2 different places actually: The connector creates an array of specified size. When the size is abnormally huge, the JVM will then throw an exception (the exchanges with the server are then in a completely wrong state and another command will generate an unexpected error). The only way to fix this is to limit the recovery buffer size. This buffer size should normally be small, since the objective is to avoid loading all results into memory. |