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

Knut Anders Hatlen updated DERBY-5751:
--------------------------------------

    Attachment: d5751-1a.diff

Attaching a patch that makes the following changes:

- Use LoopingAlphabetStream and LoopingAlphabetReader instead of
  ByteArrayInputStream and CharArrayReader so that the input data
  arrays don't need to be materialized in memory.

- Close statements and result sets earlier to allow gc of old
  test data.

- Use shared helper methods BaseTestCase.assertEquals(Reader,Reader)
  and BaseTestCase.assertEquals(InputStream,InputStream). These also
  ensure that the readers and streams are closed.

- Added new helper methods to ByteAlphabet and CharAlphabet to make
  it easier to create alphabets consisting of a single value.

Without the patch, TriggerTest fails with an OutOfMemoryError when I
give it 140 MB of heap. With the patch, it completes successfully with
110 MB of heap.
                
> Make TriggerTest less hungry on heap space
> ------------------------------------------
>
>                 Key: DERBY-5751
>                 URL: https://issues.apache.org/jira/browse/DERBY-5751
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.9.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: d5751-1a.diff
>
>
> TriggerTest.testBlobInTriggerTable() runs some tests with relatively large 
> (7MB) LOBs. These LOBs are created by allocating 7MB arrays and wrapping them 
> in ByteArrayInputStreams. It would require less memory if it used 
> LoopingAlphabetStreams instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to