Details
-
Bug
-
Resolution: Fixed
-
Major
-
9.5-rc-1
-
Unit
-
Unknown
-
N/A
-
N/A
-
Description
Each execution of a Packager Maven Plugin goal that starts XWiki (package, data, import, export) keeps the whole XWiki instance in the memory of the Maven JVM until the end of the build.
The cause is the statistics storing thread (Statistics storing daemon), which XWiki starts during its initialization, because statistics are enabled by default (xwiki.stats), and which is never stopped. Its execution context holds a clone of the XWiki context, and thus the XWiki instance with its component manager, extension repositories, Hibernate session factory and caches. Every packager execution adds one such thread.
On xwiki-platform-distribution-flavor-data-hsqldb this is several hundred MB:
- in the heap dump of the TestRelease build of stable-17.10.x #555, the thread retained 977 MB (52% of the 2 GB heap), and the build failed with an OutOfMemoryError in the assembly of the next module, xwiki-platform-distribution-flavor-jetty-hsqldb
- locally on master, the live heap after the data goal is 861 MB, 560 MB of it retained through the packager; without the statistics thread it is 311 MB, and nothing from the XWiki instance remains