sbt, the interactive build tool
Go to file
Mark Harrah 5dc671c7f8 Synchronize ClassLoaderCache and the Scala provider cache.
Construction of Scala providers was already properly synchronized jvm and machine-wide.
The cache on top of construction was not and neither was the newer ClassLoaderCache.
This could cause the same Scala version to be loaded in multiple class loaders, taking
up more permgen space and possibly decreasing performance due to less effective jit.

The issue is very rare in practice for 0.13 because of the low probability of contention
on ClassLoaderCache.  This is because the work for a cache miss is mainly the construction
of a URLClassLoader.  In 0.12, however, the work potentially involved network access and
class loading (not just class loader construction), thus greatly increasing the probability
of contention and thus duplicate work (i.e. class loader construction).

When there is contention, multiple class loaders are constructed and then preserved by the
scalaInstance task in each project throughout the first task execution.  Only when multiple
scalaInstance tasks execute simultaneously and only during the first execution does this occur.
(Technically, it could still happen later, but it doesn't in practice.)

This means that the number of duplicate class loaders should quickly saturate instead of growing
linearly with the number of projects.  It also means that the impact depends on the exact
tree structure of projects.  A linear chain of dependencies will be unaffected, but a build with
independent leaves may be limited by the number of cores.  The number of cores affects
the number of threads typically used by the task engine, which limits the number of concurrently
executing scalaInstance tasks.

In summary, this might affect the first, cold compilation of a multi-module project with
independent leaves on a multi-core machine with Scala version different from the version used
for sbt.  It might increase the maximum permgen requirements as well as slow the jit compilation
by up to one task execution.  Subsequent compilations should be unaffected and the permgen
utilization return to be as expected.
2013-06-19 21:38:06 -04:00
cache deprecations 2013-02-25 09:24:04 -05:00
compile allow java varargs main 2013-06-16 15:47:47 -04:00
interface Merge ExtendedReporter into Reporter. 2013-05-27 19:12:39 -04:00
ivy Move deprecated scala-tools conveniences to private[sbt] accessibility 2013-06-19 17:15:22 -04:00
launch Synchronize ClassLoaderCache and the Scala provider cache. 2013-06-19 21:38:06 -04:00
licenses move remaining pieces of sbt subproject to sbt_pending and fix notices 2010-09-21 21:55:50 -04:00
main Show project version in 'about' 2013-06-19 19:18:40 -04:00
project Synchronize ClassLoaderCache and the Scala provider cache. 2013-06-19 21:38:06 -04:00
run Fork run directly with 'java' to avoid additional class loader from 'scala' command. Fixes #702. 2013-04-05 09:02:24 -04:00
sbt Synchronize ClassLoaderCache and the Scala provider cache. 2013-06-19 21:38:06 -04:00
scripted scripted: launcher and scripted test versions are sbtVersion by default. 2013-06-10 16:55:09 -04:00
src Require projects to have unique target directories. 2013-06-18 18:43:50 -04:00
tasks Propagate taskDefinitionKey in Incompletes from flatMaps. Ref #784. 2013-06-15 23:55:05 -04:00
testing Added support of nested test tasks when tests are executed in SubProcess. 2013-04-25 00:06:52 +08:00
util Synchronize ClassLoaderCache and the Scala provider cache. 2013-06-19 21:38:06 -04:00
.gitattributes Added .gitattributes file. 2013-04-25 00:06:51 +08:00
.gitignore support defining Projects in .sbt files 2012-12-09 20:40:41 -05:00
CONTRIBUTING.md preparation for 0.13.0-Beta1 2013-06-01 10:56:30 -04:00
LICENSE * move Environment classes to util/env module 2010-07-14 19:24:50 -04:00
NOTICE * move Environment classes to util/env module 2010-07-14 19:24:50 -04:00
README.md fix link to CONTRIBUTING from README 2013-01-07 10:01:58 -05:00
api.specification Macro def aware recompilation. 2012-03-04 17:35:51 +01:00
scripted.specification New scripted test framework 2009-11-09 09:34:52 -05:00

README.md

sbt 0.13

This is the 0.13.x series of sbt.

  • Setup: Describes getting started with the latest binary release.
  • See CONTRIBUTING for how to build from source, open an issue, fix or add documentation, or submit a pull request.
  • FAQ: Explains how to get help, how to migrate from 0.7.7, and more.
  • There is a video of a demo given at Scala Days 2011 based on sbt 0.10.0 that gives an introduction to the configuration system in sbt 0.10.0 and later. See the documentation for current information.
  • Google Code: hosts sbt 0.7.7 and earlier versions