Attempt to optimize cpu and heap usage while reconciling projects

This commit is contained in:
aboyko
2023-01-12 11:58:25 -05:00
parent b39c38c7f0
commit fc138d7117

View File

@@ -167,8 +167,6 @@ public class RewriteReconciler implements JavaReconciler {
long end = System.currentTimeMillis(); long end = System.currentTimeMillis();
log.info("reconciling (OpenRewrite, multiple docs): " + project.getElementName() + " - " + docs.size() + " done in " + (end - start) + "ms"); log.info("reconciling (OpenRewrite, multiple docs): " + project.getElementName() + " - " + docs.size() + " done in " + (end - start) + "ms");
System.gc();
return allProblems; return allProblems;
} }
@@ -241,7 +239,7 @@ public class RewriteReconciler implements JavaReconciler {
// return allProblems; // return allProblems;
// } // }
private static final int BATCH = 10; private static final int BATCH = 50;
// Parse in batches and share the parser // Parse in batches and share the parser
private Map<IDocument, Collection<ReconcileProblem>> doReconcile(IJavaProject project, List<TextDocument> docs, private Map<IDocument, Collection<ReconcileProblem>> doReconcile(IJavaProject project, List<TextDocument> docs,
@@ -290,6 +288,8 @@ public class RewriteReconciler implements JavaReconciler {
} else { } else {
log.error("", e); log.error("", e);
} }
} finally {
System.gc();
} }
} }
return allProblems; return allProblems;