From ebeba43830a6b7df1daa4290fb7b32645ab84c75 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 6 Apr 2016 15:06:10 +0200 Subject: [PATCH] Document context cache size control in the TCF in reference manual Issue: SPR-8055 --- src/asciidoc/testing.adoc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/asciidoc/testing.adoc b/src/asciidoc/testing.adoc index 214b0dbfd8..44c42b312e 100644 --- a/src/asciidoc/testing.adoc +++ b/src/asciidoc/testing.adoc @@ -2588,6 +2588,13 @@ framework will not be able to cache application contexts between test classes an build process will run significantly slower as a result. ==== +Since Spring Framework 4.3, the size of the context cache is bounded with a default +maximum size of 32. Whenever the maximum size is reached, a _least recently used_ (LRU) +eviction policy is used to evict and close stale contexts. The maximum size can be +configured from the command line or a build script by setting a JVM system property named +`spring.test.context.cache.maxSize`. As an alternative, the same property can be set +programmatically via the `SpringProperties` API. + Since having a large number of application contexts loaded within a given test suite can cause the suite to take an unnecessarily long time to execute, it is often beneficial to know exactly how many contexts have been loaded and cached. To view the statistics for