You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kristian Waagan (JIRA)" <ji...@apache.org> on 2008/07/25 11:23:31 UTC

[jira] Updated: (DERBY-3791) Excessive memory usage when fetching small Clobs

     [ https://issues.apache.org/jira/browse/DERBY-3791?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-3791:
-----------------------------------

    Attachment: derby-3791-1a-buffer_fix.diff

'derby-3791-1a-buffer_fix.diff' makes UTF8Reader allocate a smaller buffer if possible.
The following alternatives are considered (if possible):
 - length of the byte stream (if available)
 - the maximum allowed length for the field (if set)
 - the maximum size of the buffer

In addition, the buffering of the internal stream is removed because it is already buffered at lower levels.

Note that the buffer can still be too large because we get information about the size in number of bytes. Since we don't know how many chars we get from the number of bytes, I decided to assume one char per byte. The patch will improve the situation for small streams anyway. For larger streams, the maximum buffer size will be used (8 KB).

suites.All passed.
Patch ready for review.

> Excessive memory usage when fetching small Clobs
> ------------------------------------------------
>
>                 Key: DERBY-3791
>                 URL: https://issues.apache.org/jira/browse/DERBY-3791
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.2.2.0, 10.3.1.4, 10.4.1.3, 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3791-1a-buffer_fix.diff
>
>
> When investigating DERBY-3312 I found out that performance with the embedded driver has decreased a lot as well.
> Analysis on trunk indicate excessive memory usage, causing high allocation and garbage collection costs.
> I believe there was another major performance problem in 10.3, but it appears fixed in trunk. I have not spent time identifying this problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.