hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "BELUGA BEHR (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-19682) Use Collections.emptyList() For Empty List Values
Date Wed, 03 Jan 2018 01:52:00 GMT

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

BELUGA BEHR commented on HBASE-19682:
-------------------------------------

I posted one more patch to fix the silly check-style.  Sorry about that.

I really don't think the unit test failure is related.  I can't get it to fail like this locally:

{code}
Exception in thread "testLABChunkQueue-2" java.lang.OutOfMemoryError: Java heap space
	at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
	at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
	at org.apache.hadoop.hbase.regionserver.OnheapChunk.allocateDataBuffer(OnheapChunk.java:41)
	at org.apache.hadoop.hbase.regionserver.Chunk.init(Chunk.java:100)
	at org.apache.hadoop.hbase.regionserver.ChunkCreator.getChunk(ChunkCreator.java:151)
	at org.apache.hadoop.hbase.regionserver.ChunkCreator.getChunk(ChunkCreator.java:120)
	at org.apache.hadoop.hbase.regionserver.MemStoreLABImpl.getOrMakeChunk(MemStoreLABImpl.java:272)
	at org.apache.hadoop.hbase.regionserver.MemStoreLABImpl.copyCellInto(MemStoreLABImpl.java:148)
	at org.apache.hadoop.hbase.regionserver.MemStoreLABImpl.copyCellInto(MemStoreLABImpl.java:111)
	at org.apache.hadoop.hbase.regionserver.TestMemstoreLABWithoutPool$1.run(TestMemstoreLABWithoutPool.java:156)
{code}

> Use Collections.emptyList() For Empty List Values
> -------------------------------------------------
>
>                 Key: HBASE-19682
>                 URL: https://issues.apache.org/jira/browse/HBASE-19682
>             Project: HBase
>          Issue Type: Improvement
>          Components: hbase
>    Affects Versions: 3.0.0
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Minor
>         Attachments: HBASE-19682.1.patch, HBASE-19682.2.patch, HBASE-19682.3.1.patch
>
>
> Use {{Collection.emptyList()}} for returning an empty list instead of {{return new ArrayList<>
()}}.  The default constructor creates a buffer of size 10 for _ArrayList_ therefore, returning
this static value saves on some memory and GC pressure and saves time not having to allocate
a new internally buffer for each instantiation.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message