I. Overview
The Memory Management feature provides real-time monitoring and early warning of memory and CPU utilization, designed to trigger SMS, emails, notifications and other means of warning when memory usage reaches a specified threshold. Besides, this feature also supports intelligent controls over the survival, release, template limit and lifecycle of sessions, aimed to ensure a stable operation status of the server.
| You will learn |
|---|
|
II. Introduction
1. Go to Memory Management
1) Login to the Local Decision-making Platform via Server -> Platform Management.

2) Go to Manage -> Intelligent Operations -> Memory Management.
2. Memory Alert - Real-time Memory
1) The chart visualized the memory and CPU utilization of the current system, up to 30 minutes.
2) Memory Utilization = Memory currently in use / Maximum memory.
Memory currently in use: currently used memory (in byte).
Maximum memory: maximum memory space available for use (in byte), i.e. the memory space allocated to the JVM.
3) CPU Utilization: real-time CPU utilization status, updated every 5 seconds.

3. Memory Estimation - Intelligent Alert
1) The intelligent alert feature is enabled by default and can be used to send alerts via platform messages or emails (email account needs to be pre-configured. Please refer to Mailbox Management for details).
2) Time interval for intelligent alerts: the interval between 2 alerts shall not be less than 5 minutes.
4. Memory Session
1) This tab shows data related to the Number of surviving sessions, Memory Usage Ratio, New sessions in the last 10 minutes, End of sessions in the last 10 minutes and End Session options.

2) Open 3 templates in Directory and go back to Manage -> Intelligent Operations -> Memory Session. Now you can see that there are 3 surviving sessions, 50% of memory usage ratio, 3 sessions created in the last 10 minutes and 0 ended. The specific information about templates opened is listed below.
How to calculate the size of the memory occupied by the template, Why does memory sometimes show as 0 ?
At present, there is no way to accurately count the specific size of memory occupied by a single template. Generally, it is estimated according to the number of cells.
If the template memory is 0, it may be that there is no data in the template cells, they are all charts; or the Report Row-based Engine does not load all the data at one time, so there is no way to count the total number of cells in the template, etc.
3) By default, the info about templates are arranged in ascending order of Start Time. You can manually end the selected sessions. For example, once the Detail Report A session is ended, "Number of surviving sessions" will be changed to 2, with "New sessions in the last 10 minutes" to 2 and "End of sessions in the last 10 minutes" to 1.
5. Intelligent Release
1) Memory intelligent release feature is enabled by default.
2) How does it work
Load check: with load check algorithms developed on underlying principles of JVM, the system is enabled to run load checks timely and accurately.
Dynamic release: there's no need for users to set up various threshold values. Instead, the system will choose an appropriate release strategy intelligently in line with the load status, keeping a stable operation of the system and bringing down negative impacts on users as much as possible.

6. Template Limit - General Limit
1) This can be used to set limits on all templates:
Only Submit Record Limit is disabled by default, while the other 4 options are enabled. Support custom error prompts.
Dataset Row Limit: to limit the number of rows in a template dataset (for example, set to 30000 rows). The system will prompt an error message if a single dataset contains more rows than this limit.
Template Cell Limit: to limit the number of cells in the template (for example, set to 30000 rows). The system will prompt an error message if a single template contains more cells than this limit.
Sql Execution Time: to limit the execution time of SQL queries in a template (for example, 60). The system will prompt an error message if a SQL query takes more than this limit.
Import Excel Limit: to limit the number of Excel cells importing to a template (for example, 300000). The system will prompt an error message as a pop-up on the right. If an imported Excel file contains more cells than this limit. The limit also applies to bulk imports and submits of Excel files, with its limit threshold the same as the set value.
Submit Record Limit:
Disable Cartesian Product: Allow Cartesian Product is disabled by default. The system will throw an error message if a Cartesian product is generated during data entry. The message will be prompted as a pop-up on the right, without affecting the data entered by users.
Allow Cartesian Product: you need to enable Submit Record Limit first to enable Allow Cartesian Product, in order to prevent a vast volume of data submissions generated from entering the Cartesian product, which might lead to server downtime. Once enabled, the Allow Cartesian Product option will be active by default. You can limit the number of submitted records, for example, to 30000, so the system will prompt an error message when an entered Cartesian product generates more records than that limit. The message will be prompted as a pop-up on the right, without affecting the data entered by users.
2) By checking fanruan.log, users can learn more about this limit as well as the related solutions.
7. Template Limit - Partial Restriction
1) In the case that only a few templates contain a big volume of data, users can set restrictions on these templates separately while putting general restrictions in effect on other templates. The setup processes for Partial Restriction and General Limit are generally the same.

2) This feature is disabled by default, that is, no template is selected in the initial state. Once an individual template is selected, all restriction options will be activated on it.
8. Lifecycle
1) Sessions will be checked in real-time to see if it's expired. If a session does not send requests to the back-end after a specified duration, then it will be removed. The default duration is 60 minutes.
2) Minimum allowed duration is 10 minutes, maximum 10000 minutes.