javac implementation leaks memory

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: P3
    • None
    • Affects Version/s: 6u30
    • Component/s: tools
    • None
    • generic
    • generic

      PSR test is testing a new feature where patching involves compiling classes dynamically (using javax.tools interfaces). These compilations are leaking memory.

      They can clear the cache manually by calling ZipFileIndex.clearCache(), but that interface isn't exposed through the javac tools interface.

      Further, I don't see any calls to clearCache() as I look through the code, but of course I may have missed something; here is essentially the code that it being executed:

      JavaCompiler jdk6Compiler = ToolProvider.getSystemJavaCompiler();
      DiagnosticCollector<JavaFileObject> diagnosticCollector = new DiagnosticCollector<JavaFileObject>();
      stdFileManager = jdk6Compiler.getStandardFileManager(diagnosticCollector,
       null, null);
      compilationUnits = stdFileManager.getJavaFileObjectsFromStrings(javaFileList);
      jdk6Compiler.getTask(null, stdFileManager, diagnosticCollector,
          null, null, compilationUnits).call();
      stdFileManager.close()
      compiler.close();

            Assignee:
            Jonathan Gibbons
            Reporter:
            Scott Oaks (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: