| A use case which is typically going to use a lot of memory is an asynchronous execution which manipulate a huge number of documents: while manipulating a document one by one should not be a problem for the memory usually, in the case of an async execution each manipulated document will adds an entry in the AsyncContext (XWiki#getDocument registers each document through AsyncContext#useEntity). This automatic use has a lot of value for more common content in which a modification of one of the manipulated documents will automatically cause the result to be invalidated, but this specific use (contrary to the use of web resources, for example) is pretty useless when caching is not enabled. Some ideas to improve that:
- have a maximum number of entries added to the async context
- disable the auto use when caching is disabled, depending on the type of use
- introduce an API to let a script explicitly disable use (maybe by type)
|