High memory usage with the "GetDocument" method
KBS100052
PRODUCTIssue
There were issues with the memory usage performance on an environment.
The K2 Hostserver.exe memory usage increased to 99%, and the system becomes unusable.
Symptoms
On inspection of the K2 hostserver.exe memory dump, it was found that the majority of the memory was allocated in string.
When the string was extracted from the memory dump, it was found that there were multiple documents loaded into memory.
This investigation then lead to inspection of the forms views and workflows to determine how these are loaded into memory. It was concluded that the files are loaded into memory when Get document, Get Documents and Get Document by ID methods are used in forms, views and workflows. This also occurs if an expression is built using the Document Library SmartObject in the context browser of the expression.
Resolution
It is advised that you do not use the GetDocuments methods anywhere, and specifically in these places:
1. Directly within the rules of Forms Views
2. Data sources of controls
3. Expressions
It is recommended that you use the GetDocumentsMetaData method instead.
This solved the issue, and the memory usage decreased dramatically.