hkeebler opened a new issue #1378: Look at using System.gc() in Upgrade9To10 to 
free up memory
URL: https://github.com/apache/accumulo/issues/1378
 
 
   In ticket #1365 which does the upgrade processing for ~del entries on Master 
startup will only read up to a point of memory close to full. (actually %50).  
Then it has to wait for java gc to run which could take minutes depending on 
the state of things.  The command System.gc() can be submitted to tell the java 
gc to run.  It doesn't mean the java gc will listen but testing with this has 
worked consistently multiple times.    My suggestion is to add it to the code 
below.  I don't think it could hurt anything and only helps.
   ```java
    private List<String> readCandidatesThatFitInMemory(Iterator<String> 
candidates) {
       List<String> result = new ArrayList<>();
       // Always read at least one. If memory doesn't clean up fast enough at 
least
       // some progress is made.
       while (candidates.hasNext()) {
         result.add(candidates.next());
         if (almostOutOfMemory(Runtime.getRuntime())) {
           System.gc(); <----------------------------------------------
           break;
         }
       }
       return result;
     }
   ```
   
   To test it run GCUgcUpgradeOutofMemoryTestpgrade9to10TestIT() with the 
percentage set to 25% in Upgrader9to10
     `static final float CANDIDATE_MEMORY_PERCENTAGE = 0.25f;`
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to