提交 2f9dff73 编写于 作者: K Kohsuke Kawaguchi

Fixed PermGen OutOfMemoryError during full clean build.

Plexus compiler 1.8.6 that maven-compiler-plugin 2.4 has a static field
to store a reference to the Javac class in tools.jar

In JDK that I use (6u26), Javac has a static field that stores what
appears to be a cache of jar files (ZipFileIndex.zipFileIndexCache).
And in addition, Maven instantiates a separate ClassRealm to host plugin
jar files when a project has any build extensions.

The combined result is that during a build, we end up having multiple
copies of URLClassLoader that loads tools.jar, and each ends up caching
jar files it was used. This puts a pressure to permgen (although I
couldn't pinpoint which portions of those caches use permgen), resulting
in OOME.

In Plexus compiler 1.9, Olivier added a new feature to control the
caching/reuse of Javac compiler. While this apparently was done
primarily for fixing concurrency issues in multi-threaded builds, it is
also a useful mechanism to prevent the retention of Javac classes.

So I pushed the SNAPSHOT version of maven-compiler-plugin as
2.5-jenkins-1 and tweaking POM to use it.
上级 7c51287f
......@@ -553,10 +553,11 @@ THE SOFTWARE.
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.4</version>
<version>2.5-jenkins-1</version><!-- SNAPSHOT release from rev.1336858 to pick up 'compilerReuseStrategy' flag -->
<configuration><!-- we specify this in the parent POM, so this is redundant, but otherwise IntelliJ is unhappy -->
<source>1.5</source>
<target>1.5</target>
<compilerReuseStrategy>alwaysNew</compilerReuseStrategy>
</configuration>
</plugin>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册