The following issue occurred when updating gradle from 2.5 to 2.9 java.lang.OutOfMemoryError: GC overhead limit exceeded
. I traced it back to the CachingPatternSpecFactory which is used by following code in my application (see copy task)
FileTree zip = project.zipTree(it) // a very large zip file 2GB with about 300k+ files
// only some folder should be extracted from the zip file
config.requiredFolders.each { folder ->
if (!project.file(config.getTargetDir(folder)).exists()) {
logger.lifecycle("Copying additionally required folder ${folder}")
project.copy {
from zip
into "."
include "${folder}/**";
}
}
}
Where config is a class which only provides some information about which folders to extract. This code is executed for several large zip files (2GB with about 300k+ files). It is possible to raise the Xmx value to 8GB then it will work but this should not be the solution.
The following screenshots outline the problem.
I would appreciate if you can provide a temporary solution till this problem is solved.