Maven says "Too many open files in system" and fails
See original GitHub issueI’m trying to run PIT on my code base, but lately I’ve been getting a “Too many open files in system” error. I used to be able to avoid this by calling ulimit -n 2048
(see this StackOverflow question), but lately PIT wil simply hang after a while if I do that.
I’m running PIT from Maven on a 2015 MacBook. The problem occurs with PIT 1.1.4, 1.1.5 and 1.1.6 (haven’t tried any older versions).
Any ideas?
Here’s my Maven output when using 1.1.5:
~/workspaces/equalsverifier/equalsverifier (static-analysis)$ mvn org.pitest:pitest-maven:mutationCoverage
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building EqualsVerifier 1.7.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- pitest-maven:1.1.5:mutationCoverage (default-cli) @ equalsverifier ---
[INFO] Found plugin : Default csv report plugin
[INFO] Found plugin : Default xml report plugin
[INFO] Found plugin : Default html report plugin
[INFO] Found plugin : Default limit mutations plugin
[INFO] Found shared classpath plugin : Default mutation engine
[INFO] Adding org.pitest:pitest to SUT classpath
[INFO] Mutating from /Users/jqno/workspaces/equalsverifier/equalsverifier/target/classes
2:13:59 PM PIT >> INFO : Verbose logging is disabled. If you encounter an problem please enable it before reporting an issue.
2:13:59 PM PIT >> INFO : SLAVE : objc[53294]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be
2:13:59 PM PIT >> INFO : SLAVE : used. Which one is undefined.
2:13:59 PM PIT >> INFO : Sending 293 test classes to slave
2:13:59 PM PIT >> INFO : Sent tests to slave
2:13:59 PM PIT >> INFO : SLAVE : 2:13:59 PM PIT >> INFO : Checking environment
2:14:00 PM PIT >> INFO : SLAVE : 2:14:00 PM PIT >> INFO : Found 632 tests
2:14:00 PM PIT >> INFO : SLAVE : 2:14:00 PM PIT >> INFO : Dependency analysis reduced number of potential tests by 0
2:14:00 PM PIT >> INFO : SLAVE : 2:14:00 PM PIT >> INFO : 632 tests received
|2:14:05 PM PIT >> INFO : Calculated coverage in 5 seconds.
2:14:05 PM PIT >> INFO : Created 56 mutation test units
stderr : objc[53295]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be stderr : used. Which one is undefined.
stderr : 2:14:26 PM PIT >> WARNING : Error during mutation test
java.lang.UnsupportedOperationException: Tried to retrieve value but had None.
at org.pitest.functional.Option$None.value(Option.java:89)
at org.pitest.mutationtest.engine.gregor.GregorMutater.getMutstderr : ation(GregorMutater.java:120)
at org.pitest.mutationtest.execute.MutationTestWorker.processMutation(MutationTestWorker.java:91)
at org.pitest.mutationtest.execute.MutationTestWorker.run(MutationTestWorker.java:77)
at org.pitest.mutationtest.execute.Mutastderr : tionTestSlave.run(MutationTestSlave.java:84)
at org.pitest.mutationtest.execute.MutationTestSlave.main(MutationTestSlave.java:113)
2:14:26 PM PIT >> WARNING : Slave exited abnormally due to RUN_ERROR
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.433 s
[INFO] Finished at: 2015-09-14T14:14:26+02:00
[INFO] Final Memory: 12M/278M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.pitest:pitest-maven:1.1.5:mutationCoverage (default-cli) on project equalsverifier: Execution default-cli of goal org.pitest:pitest-maven:1.1.5:mutationCoverage failed: java.io.IOException: Cannot run program "/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/bin/java" (in directory "/Users/jqno/workspaces/equalsverifier/equalsverifier"): error=23, Too many open files in system
[ERROR]
[ERROR] Please copy and paste the information and the complete stacktrace below when reporting an issue
[ERROR] VM : Java HotSpot(TM) 64-Bit Server VM
[ERROR] Vendor : Oracle Corporation
[ERROR] Version : 25.45-b02
[ERROR] Uptime : 29327
[ERROR] Input ->
[ERROR] 1 : -Xmx512m
[ERROR] 2 : -XX:MaxPermSize=128m
[ERROR] 3 : -Dclassworlds.conf=/usr/local/Cellar/maven/3.3.3/libexec/bin/m2.conf
[ERROR] 4 : -Dmaven.home=/usr/local/Cellar/maven/3.3.3/libexec
[ERROR] 5 : -Dmaven.multiModuleProjectDirectory=/Users/jqno/workspaces/equalsverifier/equalsverifier
[ERROR] BootClassPathSupported : true
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
"Too many open files" exception while running mvn org ...
"Too many open files" usually means that your java process is not allowed to open any more file descriptors. However if this happens...
Read more >How to solve "Too many Open Files" in Java applications
The error Java IOException “Too many open files” can happen on high-load servers and it means that a process has opened too many...
Read more >Big Sur: too many open files - Apple Support Communities
Big Sur: too many open files. I am working as a software developer and I use maven for building a heavy Java project....
Read more >Too many open files - Maven assemble plugin |
mvn --version Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1 ... Maven assemble plugin throw Too many open files Exception caused build failed
Read more >Resolve "Too Many Open files error" and "native ... - IBM
9) How to fix this? IBM support recommends the number of open files setting ulimit -n value for WebSphere Application Server running on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jqno Now reproduced - by running
On that branch without invoking pitest.
Closing the stream seems to fix the issue.
@jqno Glad I could help - think I made exactly the same mistake with classloader resources a while ago.