Skip to content

Commit ebeba43

Browse files
committed
Document context cache size control in the TCF in reference manual
Issue: SPR-8055
1 parent 5bd5c74 commit ebeba43

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/asciidoc/testing.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2588,6 +2588,13 @@ framework will not be able to cache application contexts between test classes an
25882588
build process will run significantly slower as a result.
25892589
====
25902590

2591+
Since Spring Framework 4.3, the size of the context cache is bounded with a default
2592+
maximum size of 32. Whenever the maximum size is reached, a _least recently used_ (LRU)
2593+
eviction policy is used to evict and close stale contexts. The maximum size can be
2594+
configured from the command line or a build script by setting a JVM system property named
2595+
`spring.test.context.cache.maxSize`. As an alternative, the same property can be set
2596+
programmatically via the `SpringProperties` API.
2597+
25912598
Since having a large number of application contexts loaded within a given test suite can
25922599
cause the suite to take an unnecessarily long time to execute, it is often beneficial to
25932600
know exactly how many contexts have been loaded and cached. To view the statistics for

0 commit comments

Comments
 (0)