mirror of https://github.com/sbt/sbt.git
Upon successful registration with a FileTreeRepository, an Observable is returned by the FileTreeRepository that can be used to observer the specific globs that were registered. The FileTreeRepository also has a global Observable that can be used to monitor _all_ events. In order to implement this feature, internally the FileTreeRepository needs to hold a reference to the registered Observable so that it forwards relevant file change events. If we do not close the Observable, it leaks memory inside of FileTreeRepository. There were a number of places within sbt where we registered globs and did nothing with the returned Observable. It was thus straightforward to fix the leak by just closing the returned Observables. This came up because I was looking at a heap dump of https://github.com/jtjeferreira/sbt-multi-module-sample after running 1000 no-op compiles and noticed that the FileTreeRepository.observables were taking up 75MB out of a total heap of about 300MB. As a side note, it would be nice if sbt had a warning for unused return values when a statement is not the last in a block. It's possible that these leaks wouldn't have happened if we were forced to handle the returned Observables. |
||
|---|---|---|
| .github/ISSUE_TEMPLATE | ||
| client | ||
| core-macros/src/main/scala/sbt/internal/util/appmacro | ||
| internal | ||
| launch | ||
| licenses | ||
| main | ||
| main-actions/src | ||
| main-command/src | ||
| main-settings/src | ||
| notes | ||
| project | ||
| protocol/src/main | ||
| run | ||
| sbt/src | ||
| scripted-plugin/src/main/scala/sbt | ||
| scripted-sbt-old/src/main/scala/sbt/test | ||
| scripted-sbt-redux | ||
| server-test/src | ||
| src/main/conscript | ||
| tasks | ||
| tasks-standard | ||
| testing | ||
| util-cache | ||
| util-tracking | ||
| vscode-sbt-scala | ||
| zinc-lm-integration/src | ||
| .appveyor.yml | ||
| .gitattributes | ||
| .gitignore | ||
| .java-version | ||
| .mailmap | ||
| .scalafmt.conf | ||
| .travis.yml | ||
| CONTRIBUTING.md | ||
| DEVELOPING.md | ||
| LICENSE | ||
| NOTICE | ||
| PROFILING.md | ||
| README.md | ||
| SUPPORT.md | ||
| build.sbt | ||
| reset.sh | ||
| sbt-allsources.sh | ||
| server.md | ||
README.md
sbt
sbt is a build tool for Scala, Java, and more.
For general documentation, see https://www.scala-sbt.org/.
sbt 1.x
This is the 1.x series of sbt. The source code of sbt is split across several GitHub repositories, including this one.
- sbt/io hosts
sbt.iomodule. - sbt/librarymanagement hosts
sbt.librarymanagementmodule that wraps Ivy. - sbt/zinc hosts Zinc, an incremental compiler for Scala.
- sbt/sbt, this repository hosts modules that implements the build tool.
Other links
- Setup: Describes getting started with the latest binary release.
- FAQ: Explains how to get help and more.
- sbt/sbt-zero-seven: hosts sbt 0.7.7 and earlier versions
Issues and Pull Requests
Please read CONTRIBUTING carefully before opening a GitHub Issue.
The short version: try searching or asking on StackOverflow.
license
See LICENSE.