EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB7295: What is the Memory Contract Manager in MicroStrategy Intelligence Server? PART 2


Community Admin

• Strategy


The following knowledge base article is a continuation of KB7295. It explains the Memory Contract Manager.

Summary: This Document provides a thorough explanation of the Memory Contract Manager in Strategy. It is divided in 2 parts. Part 1 can be found in the following link:
KB7295: What is the Memory Contract Manager in MicroStrategy Intelligence Server 10.x and later? PART 1
 
 
Memory Governing Examples:
Below are examples of the two types of potential memory depletions that are governed by MCM.
 
Example 1: System Memory Depletion
The example below shows a potential memory depletion of system memory.
 

ka04W00000148quQAA_0EM4400000029HF.gif

 
In this example, the Strategy Intelligence Server services request A. Once serviced, a new memory contract is granted and accounted for in the available system memory. In the example, request B is denied because it will result in potential memory depletion due to available system memory. Once request B has been rejected, Strategy Intelligence Server enters the memory request idle mode. In this mode of operation, all requests that do not meet requirement are denied. Only a request of size less than LWM - 1.05 *(Strategy Intelligence Server PB) - Outstanding Contracts will be serviced. 1.05 is a safety factor and the LWM is defined as 95 percent of the HWM when a request was first denied.
 
In the example above, request C will only be serviced if the Strategy Intelligence Server private bytes, outstanding contracts, and the request size fall below the LWM either if the Strategy Intelligence Server PB or outstanding contracts are released. Otherwise, request C will be denied and request D will be serviced and Strategy Intelligence Server will switch out of request idle mode and resume normal operation.
 
If there are numerous requests of similar or bigger size than C before one similar to D and that at the time of one such request, the Memory Request Idle Time was exceeded; Strategy Intelligence Server will shut down and restart itself.
 
 
Example 2: Virtual Byte Depletion
Below is an example of potential memory depletion due to available bytes in the Strategy Intelligence Server virtual address space.
 

ka04W00000148quQAA_0EM4400000029HD.gif

 
In this, request A would be denied because at the time of the request, the Strategy Intelligence Server virtual byte utilization was above an acceptable level (90 percent), and the requested memory would result in further depletion of virtual address space for the Strategy Intelligence Server.
 
Requests continue to be denied until the Strategy Intelligence Server private bytes, outstanding contacts, and the new request total under the LWM, shown above as request B. In the situation above, the HWM is calculated as the Strategy Intelligence Server private bytes at the time when unacceptable levels of virtual byte utilization were first detected. Once the virtual byte HWM has been set, it will not be recalculated. The LWM is 95 percent of the HWM as it was in the previous example.
 
The following flow chart depicts the logic that the MCM uses to grant or deny requests.

ka04W00000148quQAA_0EM4400000029HG.gif

 
 
There is an assumption that when the VB of I-Server has reached 90% of the UAS, the level of the I-Server PB will be the maximum it can ever reach without the risk of memory depletion. As a result, this HWM (denoted as HWM1 is the above flow chart) is not expected to change and will only be calculated once. The logical step of using the minimum of HWM1 and HWM2 takes into account that after a scenario in which I-Server VB exceeded 90% of the UAS, other processes' memory consumption may grow and result in less available memory. This will cause HWM2 to be lower than HWM1 and it used instead. In addition, please note that the I-Server VB, PB, HWM and LWM are updated in a regular frequency or if the request is greater than 10MB.
 
What is the Single Allocation Limit?
When a task requests for a contract, its size will be compared to the Single Allocation Limit. If it is larger than the limit, it will be immediately denied. The minimum value is 20MB. This is to ensure basic functionality. The maximum value is 2 GB.
 
What is Reserved Memory under Memory Contract Manager?
Reserved Memory is the amount of system memory that cannot be used by the Strategy Intelligence Server. Although it has the same name, this does not refer to one of the states of memory address space for the OS.
 
When enabled, if other processes account for less memory than the Reserved Memory, the value of the Reserved Memory will be used to calculate the amount of free system memory Intelligence Server has available. If the other processes account for more memory than the setting, the actual memory used by the other processes will be used in the calculations.
 
A value of 0 disables reserving memory for other processes. The maximum is 2000 MB.
 
 
How does MCM manage to service all the memory requests in a timely fashion?
The MCM is exposed to a huge amount of requests coming from the various tasks on behalf of each job under especially stressed conditions of the Strategy Intelligence Server. Since the MCM is a multi-threaded component and is a singleton in the Strategy Intelligence Server kernel, it is important that it ensures thread safety to preserve the integrity of its Contract List. To improve efficiency, the MCM uses a buffering mechanism. Up to a page is always kept in a buffer (Memory Contract Object). These pages in buffer are already included in the MCM contract list as allocated.
 
The tasks mentioned earlier do not communicate with the MCM directly but via a so-called 'Memory Contract' object. Each task has its own Memory Contract. A Memory Contract object communicates with the MCM to initiate a single contract and it maintains a block of contracted memory size internally. When a memory allocation request comes in, it first checks if the requested memory size fits in the internally maintained memory size. If it fits in, Memory Contract object does not contact the MCM for this request. Instead, it silently updates its own internal memory size. If the requested size does not fit in, Memory Contract object asks the MCM for more memory and the MCM will update the contract list. The additional memory request from the Memory Contract object to the MCM is always in multiples of the Windows memory page size (4K=4,096 bytes). For example, if 9K additional bytes are required and the Memory Contract object currently holds 3K, Memory Contract object will ask the MCM to update the contract with three additional pages. One of the pages will be for the buffer.
 

ka04W00000148quQAA_0EM4400000029HE.gif

 
However, a subsequent memory request of 1K bytes, for example, will be deducted from an existing page of 4K and no MCM interaction will be involved.
 
 
For additional information on memory tuning and settings, refer to the following Strategy Knowledge Base Document:
 
KB5866: Tuning MicroStrategy Intelligence Server for Memory Usage
 


Comment

0 comments

Details

Knowledge Article

Published:

June 1, 2017

Last Updated:

May 7, 2021