JSPWiki contains multiple internal caches, which are used to store often-used information. However, caches are always a tradeoff between speed and memory, and thus it is useful to know what is going on so that you can tune the performance of your application.

Page data cache#

The CachingProvider stores a small information chunk for each page in main memory. This contains things such as who has access to this page, any page variables defined on the page, etc. The cache is relatively small, only few hundred bytes per page, and therefore it is recommended to keep this on at all times, as it provides considerable speedup.

The page data cache is controlled by the following statement in the jspwiki.properties file:

If set to false, then the cache is not used. This may be useful in cases where you expect to manipulate the pages often outside of the JSPWiki routines (e.g. by another application accessing the same repository). Normally JSPWiki can pick up changes to the pages whenever they are accessed, but there are certain special cases where it may be that changes are not noticed.

The useCache also controls caching of attachment data (though not the content - that would be too hard on memory).

Page content cache#

JSPWiki stores often-used page data (the WikiMarkup) in the page content cache. This cache is controlled with the

where <n> is the number of entries that the cache can store. If you are running a small wiki, it's probably a good idea to make this number as large or larger than the number of pages in your repository. If you're running a very large wiki, be aware that caching all of the pages can take a large amount of space.

These are experimentally derived JVM heap size values for the different cache sizes, assuming that the cache gets full (i.e. you have at least this many pages).

capacity recommended heap size
100-500 -Xmx64m
500-3000 -Xmx128m

If jspwiki.useCache is set to false, then the page content cache is not used.

Page history cache#

To make listing of page histories faster, we also cache the page histories. This cache takes its values directly from the page content cache, above, so there are no special parameters to tune it.

Rendering document cache#

As of JSPWiki 2.4, we also can cache the rendered pages, i.e. the ready HTML which comes out of the MarkupParser. This is stored as a so-called DOM tree, and it can be pretty memory-consuming. You may control it with the value


where <n> is again a number of cache entries to store. If you wish to disable the RenderingManager caches, then you can set the value to "0" (zero).

Every 500 cache entries should increase your heap size by about 32M.

NB: The rendering document cache is new in 2.4. As 2.4 is not yet stable (i.e. it's still in 2.3.x branch), this parameter may still change in value. At the moment, this documentation refers to 2.3.101.

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-5) was last changed on 02-Apr-2008 06:53 by BillGao