gortiz commented on code in PR #12242:
URL: https://github.com/apache/pinot/pull/12242#discussion_r1453021005


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/forward/VarByteChunkSVForwardIndexReader.java:
##########
@@ -85,6 +85,10 @@ private String getStringCompressed(int docId, 
ChunkReaderContext context) {
 
     int length = valueEndOffset - valueStartOffset;
     byte[] bytes = _reusableBytes.get();
+    if (bytes.length < _lengthOfLongestEntry) {

Review Comment:
   >  repetitive allocation of byte[] array per query, query latency might 
tumble
   
   This is just a single byte[] that is taken for few ms, so it should never 
reach the old gen.
   
   > need to check the usage of ReaderContext carefully to ensure the close() 
will be invoked finally after the query is completed
   
   That is not like that AFAIU. First, the context should be closed right now. 
Otherwise other indexes may be leaking. Even if there is a bug and it is not 
being closed, what should be clear is that we should not have a reference to 
that context once the query finishes, so it will be eventually (and again, 
probably in the young gen) get collected, which will collect the byte[].



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to