vvivekiyer commented on code in PR #10373:
URL: https://github.com/apache/pinot/pull/10373#discussion_r1124883625


##########
pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java:
##########
@@ -785,6 +789,9 @@ public static class Accounting {
 
     public static final String CONFIG_OF_INSTANCE_TYPE = 
"accounting.instance.type";
     public static final InstanceType DEFAULT_CONFIG_OF_INSTANCE_TYPE = 
InstanceType.SERVER;
+
+    public static final String CONFIG_OF_GC_WAIT_TIME = 
"accounting.gc.wait.time.ms";

Review Comment:
   Please rename to CONFIG_OF_GC_WAIT_TIME_MS



##########
pinot-core/src/main/java/org/apache/pinot/core/accounting/PerQueryCPUMemAccountantFactory.java:
##########
@@ -724,14 +745,14 @@ void killAllQueries() {
        */
       private void killMostExpensiveQuery() {
         if (!_aggregatedUsagePerActiveQuery.isEmpty() && 
_numQueriesKilledConsecutively >= _gcTriggerCount) {
-          System.gc();
           _numQueriesKilledConsecutively = 0;
+          System.gc();
           try {
-            Thread.sleep(_normalSleepTime);
+            Thread.sleep(_gcWaitTime);
           } catch (InterruptedException ignored) {
           }
           _usedBytes = MEMORY_MX_BEAN.getHeapMemoryUsage().getUsed();
-          if (_usedBytes < _criticalLevel) {
+          if (_usedBytes < _criticalLevelAfterGC) {

Review Comment:
   Would this end up killing more queries than usual when just killing one 
query would have been sufficient?   
   
   Let's say 
   criticalThreshold=95%
   usedMemory=96%
   CriticalLevelAFterGC=80%
   
   After performing GC in L749, if the usedMemory=85%, we would end up killing 
the most expensive query even though the criticalThreshold is 95%. Is that 
expected?
   
   



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