summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-12-09 23:22:08 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-12-09 23:22:09 +0000
commit590e95867b5506749587dfccb891ffd853143979 (patch)
tree7e43af54b66d0bf29aba1bed67dcf8ba05703fd1
parente47308ad0c36f7ddbb1e3f21ba33d7fc97ce7437 (diff)
parent55483bf254d240b5e4937119bf2f2df9ae88bda5 (diff)
downloadbase-590e95867b5506749587dfccb891ffd853143979.tar.gz
Merge "81638: Execution failed > PermGen space" into studio-1.1-dev
-rw-r--r--lint/cli/src/main/java/com/android/tools/lint/EcjParser.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/lint/cli/src/main/java/com/android/tools/lint/EcjParser.java b/lint/cli/src/main/java/com/android/tools/lint/EcjParser.java
index a4ee3a26c4..d7fc0097ce 100644
--- a/lint/cli/src/main/java/com/android/tools/lint/EcjParser.java
+++ b/lint/cli/src/main/java/com/android/tools/lint/EcjParser.java
@@ -260,6 +260,8 @@ public class EcjParser extends JavaParser {
try {
compiler.compile(sourceUnits.toArray(new ICompilationUnit[sourceUnits.size()]));
} catch (OutOfMemoryError e) {
+ environment.cleanup();
+
// Since we're running out of memory, if it's all still held we could potentially
// fail attempting to log the failure. Actively get rid of the large ECJ data
// structure references first so minimize the chance of that
@@ -296,6 +298,10 @@ public class EcjParser extends JavaParser {
} else {
t.printStackTrace();
}
+ } finally {
+ if (environment != null) {
+ environment.cleanup();
+ }
}
}