Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set `fork := true` by default, or debug memory leaks with `fork := false`

See original GitHub issue

Issue Description


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”


observe memory-pressure and eventual OOM


Memory gets properly GC’d, and the shell can run for effectively unbounded time.


  • 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:open
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

OlegYchcommented, Apr 22, 2018

i’ve written a bit about debugging this

eed3si9ncommented, Mar 4, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found