Issue Details (XML | Word | Printable)

Key: JDBC-497
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Mark Rotteveel
Reporter: A Drouard
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Jaybird JCA/JDBC Driver

Slow read of blob and high memory usage

Created: 01/Jun/17 09:50 AM   Updated: 05/Jun/17 01:14 PM
Component/s: JDBC driver
Affects Version/s: Jaybird 3.0.0
Fix Version/s: Jaybird 3.0.1, Jaybird 4

File Attachments: 1. Java Source File TestReadBlob.java (3 kB)

Environment: Windows 8, Java 8, Firebird 2.5


 Description  « Hide
I recently upgraded from Jaybird 2.2.9 to Jaybird 3.0.0.
My application is reading a lot of BLOB, and since the upgrade, I noticed a degradation of performance and memory usage.
The problem is particulary visible when reading 2 BLOB columns.

-----------------------------------
Reading 1 blob column :
Jaybird 2.2.9 : 300 000 rows fetched in 45 564 ms, connection closed in 0 ms, heap memory usage : 20 MB
Jaybird 3.0.0 : 300 000 rows fetched in 77 130 ms, connection closed in 28 000 ms, heap memory usage : 687 MB
-----------------------------------
Reading 2 blob columns :
Jaybird 2.2.9 : 300 000 rows fetched in 102 960 ms, connection closed in 1 ms, heap memory usage : 25 MB
Jaybird 3.0.0 : 300 000 rows fetched in 325 930 ms, connection closed in 16 3967 ms, heap memory usage : 653 MB

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 01/Jun/17 02:28 PM
What is the size of the blobs on average?

A Drouard added a comment - 01/Jun/17 02:43 PM
 The size of the blobs on average is 200 bytes.

Mark Rotteveel added a comment - 03/Jun/17 08:59 AM
It looks like Jaybird is not removing the blob handles from databaseListenerDispatcher after blob close.

Mark Rotteveel added a comment - 03/Jun/17 02:54 PM
The problem was indeed a leak of blob handles.

Snapshot with fix on Maven Sonatype snapshot repository as 3.0.1-SNAPSHOT

Download:
Java 7: https://www.dropbox.com/s/2ff6xe88ybyyzwh/Jaybird-3.0.1-SNAPSHOT-JDK_1.7.zip?dl=0
Java 8: https://www.dropbox.com/s/m7dk3cf4t0lpwvd/Jaybird-3.0.1-SNAPSHOT-JDK_1.8.zip?dl=0

I'm considering to release 3.0.1 soon.

Mark Rotteveel added a comment - 03/Jun/17 03:08 PM
Clarification: "Soon" means somewhere next week (probably Monday)

Mark Rotteveel added a comment - 05/Jun/17 01:14 PM