Set `fork := true` by default, or debug memory leaks with `fork := false`
See original GitHub issueIssue Description
steps
context: discussion in gitter with @hvesalai beginning here and ending here
- open an SBT shell with e.g. 2GB of memory
- run tests or any tasks for “a while”
problem
observe memory-pressure and eventual OOM
expectation
Memory gets properly GC’d, and the shell can run for effectively unbounded time.
notes
- if
fork := true
is recommended for SBT repls to avoid OOMs, it should be the default - and/or: we should try to understand why large amounts of memory are leaking
sbt version: ≤1.1.1
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Check 0.15.2: 4 Advanced Features
It turns out this is a consequence of using fork() to run a unit test in its own process memory space, which Check...
Read more >Maven Surefire Plugin – Fork Options and Parallel Test ...
The default setting is forkCount=1 / reuseForks=true , which means that maven-surefire-plugin creates one new JVM process to execute all ...
Read more >fork() is causing memory leak - Stack Overflow
This memory leak is related to the recursion. You do not close the directory handles further up the stack:
Read more >4. Advanced Features - Check 0.10.0
If the "still reachable" memory leaks are a concern, and one required that the unit test program report that there were no memory...
Read more >Dr. Memory Runtime Option Reference
default : true ... On Linux, monitoring always continues across a fork. ... If this option is set to false, the callstack walk...
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 Free
Top 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
i’ve written a bit about debugging this https://github.com/OlegYch/blog/blob/master/sbt-fork.md
I put “Needinfo” label here, but I don’t want it to be interpreted as “this is not a bug.” If there were no OOM in 0.13, but you and others are seeing them in sbt 1.x, there’s a potential that sbt has regressed related to testing.