Decrease memory consumption

This commit is contained in:
Alexey Andreev 2019-02-25 18:44:11 +03:00
parent e8312021f2
commit 35730d665f
3 changed files with 7 additions and 9 deletions

View File

@ -738,18 +738,18 @@ public abstract class DependencyAnalyzer implements DependencyInfo {
node.method = null;
}
allNodes.clear();
classSource.cleanup();
agent.cleanup();
}
public void cleanupTypes() {
for (DependencyNode node : allNodes) {
if (node.typeSet != null) {
node.typeSet.cleanup();
}
}
allNodes.clear();
classSource.cleanup();
agent.cleanup();
}
public void cleanupTypes() {
for (MethodReference reachableMethod : getReachableMethods()) {
MethodDependency dependency = getMethod(reachableMethod);
for (int i = dependency.getParameterCount() + 1; i < dependency.getVariableCount(); ++i) {

View File

@ -66,7 +66,6 @@ class TypeSet {
}
types.set(type.index);
typesCount++;
return;
}
DependencyType[] getTypes() {

View File

@ -388,6 +388,7 @@ public class TeaVM implements TeaVMHost, ServiceRepository {
dependencyAnalyzer.getClassSource());
cacheStatus.addSynthesizedClasses(dependencyAnalyzer::isSynthesizedClass);
dependencyAnalyzer.setInterruptor(null);
dependencyAnalyzer.cleanup();
if (wasCancelled()) {
return;
@ -463,8 +464,6 @@ public class TeaVM implements TeaVMHost, ServiceRepository {
return null;
}
dependencyAnalyzer.cleanup();
return classSet;
}