Driver version
8.4.1
SQL Server version
15
Client Operating System
Ubuntu 20
JAVA/JVM version
11
Table schema
N/A
Problem description
There is alloc of char and byte arrays/buffers on every writeReader invocation:
|
char[] streamCharBuffer = new char[2 * currentPacketSize]; |
We use SQLServerBulkCopy to write data from file to SQL Server and it yields few GiB/s of mem allocations.
- Expected behaviour:
char/byte buffer is created once per TDSWriter and reused on subsequent writes
- Actual behaviour:
char and byte arrays/buffers on every writeReader invocation
- Error message/stack trace:
- Any other details that can be helpful:
JDBC trace logs
Reproduction code
Call SQLServerBulkCopy#writeToServer many times
Driver version
8.4.1
SQL Server version
15
Client Operating System
Ubuntu 20
JAVA/JVM version
11
Table schema
N/A
Problem description
There is alloc of char and byte arrays/buffers on every writeReader invocation:
mssql-jdbc/src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Line 4099 in 8c0d32b
We use SQLServerBulkCopy to write data from file to SQL Server and it yields few GiB/s of mem allocations.
char/byte buffer is created once per TDSWriter and reused on subsequent writes
char and byte arrays/buffers on every writeReader invocation
JDBC trace logs
Reproduction code
Call SQLServerBulkCopy#writeToServer many times