Apache9 commented on a change in pull request #3947:
URL: https://github.com/apache/hbase/pull/3947#discussion_r776588895



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ChunkCreator.java
##########
@@ -134,51 +134,36 @@ public static ChunkCreator getInstance() {
     return instance;
   }
 
-  /**
-   * Creates and inits a chunk. The default implementation for a specific 
chunk size.
-   * @return the chunk that was initialized
-   */
-  Chunk getChunk(ChunkType chunkType) {
-    return getChunk(CompactingMemStore.IndexType.ARRAY_MAP, chunkType);

Review comment:
       > MemStoreLABImpl.getNewExternalChunk(ChunkType) is called by 
CellChunkImmutableSegment.allocIndexChunks to allocate 
IndexChunk(CellChunkImmutableSegment itself is IndexType.CHUNK_MAP), because 
the IndexType.ARRAY_MAP, it does not put the IndexChunk in 
ChunkCreator.chunkIdMap when the IndexChunk could not be pooled , but it does 
no matter because it is a IndexChunk not a DataChunk, and IndexChunk is put in 
CellChunkMap.chunks, which prevents it is GC-ed. If we put the IndexChunk in 
ChunkCreator.chunkIdMap when using the correct
   > IndexType.CHUNK_MAP, there not cause memory leak because when the 
MemStoreLAB is closed, ChunkCreator.removeChunk is invoked to remove the chunk 
from this ChunkCreator.chunkIdMap
   
   Here, you also explained that, in CellChunkImmutableSegment, when creating 
IndexChunk, we used to use ARRAY_MAP, but after the change, we will use 
CHUNK_MAP. And the performance is about reading, not writing... I'm not sure 
why they used to choose ARRAY_MAP for index chunks...




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to