Improve Performance and Memory Consumption (KULRICE-6557)

[KULRICE-7012] Limit the size of form storage in session Created: 26/Mar/12  Updated: 03/Apr/13  Resolved: 27/Sep/12

Status: Closed
Project: Kuali Rice Development
Component/s: Development
Affects Version/s: None
Fix Version/s: 2.2.0-m4, 2.2
Security Level: Public (Public: Anyone can view)

Type: Sub Task Priority: Critical
Reporter: Jerry Neal (Inactive) Assignee: Claus Niesen
Resolution: Complete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
cloned from KULRICE-7011 Work on adding form clearing point on... Open
Similar issues:
KULRICE-6699Reduce view size for session storage and form clearling
KULRICE-2159Add limited cache size for documents stored in session
KULRICE-12505JS Error with session storage when using Safari in private browsing mode
KULRICE-1569session form work made it so were parsing the request before we know what the upload limit is
KULRICE-8638File size limitation on attachments (if more than 500KB file size,)
KULRICE-1352form is not restored from session for multipart request
KULRICE-1919EDL Form Definition schema currently puts a limit on the size of javascript custom validators
KULRICE-9107KRAD Equivalency: Storage of the search results in the session backed by a table
KULRICE-7007Add flags to view to disable storing of form in session
KULRICE-8427Handling of Session Timeouts
Rice Module:
KAI Review Status: Not Required
KTI Review Status: Not Required


Currently as users make requests forms are added to the UifFormManager which is added to session. If the forms are not properly cleared out they keep getting added until memory is filled up. We need to provide some safeguard to keep the form storage from going over a certain configured limit of memory.

Here are some thoughts:

1) Enhance UifFormManager to keep track of the memory the forms are consuming (if possible, if not might have to go by form count)
2) Introduce Rice configuration parameter that configures how much memory a particular manager can hold (note this would be on a per user session bases).
3) As the memory usage goes about the threshold, serialize out forms to the database. Need to create a new service like SessionDocumentService that can store general forms to the database. If a request comes in for a form that is not in memory, attempt to get it from the database. Might be good to keep a last referenced time so we keep the most recently used forms in memory.
4) Implement a timeout on form objects. This is independent of the users session. So if a form has not been accessed in X number of minutes, it will be cleared from the memory or database. This should be a Rice configuration parameter as well

Comment by Jerry Neal (Inactive) [ 27/Sep/12 ]

This was actually done by introducing a max number of forms configuration

Generated at Wed Jun 03 10:48:33 CDT 2020 using JIRA 6.1.5#6160-sha1:a61a0fc278117a0da0ec9b89167b8f29b6afdab2.