[ 
https://issues.apache.org/jira/browse/GEODE-6687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16832867#comment-16832867
 ] 

ASF subversion and git services commented on GEODE-6687:
--------------------------------------------------------

Commit aa630830f1c3694bc26366dcec3ed0d40b827222 in geode's branch 
refs/heads/develop from Darrel Schneider
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=aa63083 ]

GEODE-6687: replace ByteArrayInputStream+DataInputStream with 
ByteArrayDataInput (#3547)

* Code that used DataInputStream(ByteArrayInputStream) as a DataInput now use 
ByteArrayDataInput.
* Added a unit test that showed that ByteArrayDataInput.readFully(byte[])
would throw IndexOutOfBoundsException instead of EOFException.
To fix this changed readFully(byte[]) to call readFully(byte[],int,int)
which was correctly implemented to throw EOFException.

* readLine is now implemented on ByteArrayDataInput.
The old implementation just threw an exception.


> org.apache.geode.internal.ByteArrayDataInput can be used in place of 
> ByteArrayInputStream+DataInputStream
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-6687
>                 URL: https://issues.apache.org/jira/browse/GEODE-6687
>             Project: Geode
>          Issue Type: Improvement
>          Components: serialization
>            Reporter: Darrel Schneider
>            Assignee: Darrel Schneider
>            Priority: Major
>              Labels: performance
>             Fix For: 1.10.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> A number of places in geode wrap a byte array in a ByteArrayInputStream which 
> then is given to a DataInputStream. Because the DataInputStream always 
> allocates some byte arrays and char arrays (even if they will not be used) 
> this can generate a good deal of extra garbage.
> Geode has an existing class, org.apache.geode.internal.ByteArrayDataInput, 
> that can be used to replace a ByteArrayInputStream+DataInputStream and will 
> generate less garbage.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to