kezhenxu94 commented on a change in pull request #7204:
URL: https://github.com/apache/skywalking/pull/7204#discussion_r661085028



##########
File path: 
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/PersistenceTimer.java
##########
@@ -203,16 +203,18 @@ private void extractDataAndSave(IBatchDAO batchDAO) {
         }
     }
 
-    @RequiredArgsConstructor
     static class DefaultBlockingBatchQueue<E> implements BlockingBatchQueue<E> 
{
-
         @Getter
         private final int maxBatchSize;
-
+        private final List<E> elementData;
         @Getter
         private boolean inAppendingMode = true;
 
-        private final List<E> elementData = new ArrayList<>(50000 * 3);
+        public DefaultBlockingBatchQueue(final int maxBatchSize) {
+            this.maxBatchSize = maxBatchSize;
+            // Use the maxBatchSize * 2 as the initial queue size to avoid 
ArrayList#grow
+            this.elementData = new ArrayList<>(maxBatchSize * 3);

Review comment:
       Comment `maxBatchSize * 2` doesn't accord to real code `maxBatchSize * 3`




-- 
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