[ https://issues.apache.org/jira/browse/CASSANDRA-18280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17738283#comment-17738283 ]
Jonathan Ellis commented on CASSANDRA-18280: -------------------------------------------- (This has moved to {color:#000000}ResettableByteBuffersIndexOutput){color} > Investigate initial size of GrowableByteArrayDataOutput in RAMIndexOutput > ------------------------------------------------------------------------- > > Key: CASSANDRA-18280 > URL: https://issues.apache.org/jira/browse/CASSANDRA-18280 > Project: Cassandra > Issue Type: Task > Components: Feature/SAI > Reporter: Mike Adamson > Priority: Normal > > The GrowableByteArrayDataOutput in RAMIndexOutput is currently initialized > with a size of 128 bytes. There is no explanation as to why this size was > chosen. > The GrowableByteArrayDataOutput does not lazily allocate memory but only ever > allocates enough for each write operation. This can lead to a lot of fresh > allocations and calls to System.arrayCopy. > Since RAMIndexOutput is used to build the on-disk postings in SAI it is > likely that the size of the in-memory array is going to grow considerably > more that 128 bytes. > We should investigate changing this initial value to something higher and > possibly changing the GrowableByteArrayDataOutput class to allocate in blocks > rather than write increments. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org