This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice This article is not considered official documentation for K2 software and is provided "as is" with no warranties.


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. 



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. 


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.