> Source: [sk119553](https://support.checkpoint.com/results/sk/sk119553)

# sk119553 - Security Management API server crashes under heavy load

| Property | Value |
|----------|-------|
| Solution ID | sk119553 |
| Date Created | 2017-08-06 |
| Last Modified | 2022-07-05 |
| Technical Level | General |
| Products | Security Management Server |
| Versions | R82.10, R82, R81.20, R82.x, R82.20 |

## Symptoms

- * Security Management API server crashes under heavy load and must be restarted.
* $FWDIR/log/api.elg before the crash shows: 
  `
  DATE TIME,370 INFO com.checkpoint.management.web_api_is.utils.helpers.ApiCache.<init>:25 `  
  `
  [qtp-828976840-28] - Cache created and initialized`  
  `
  DATE TIME,370 INFO com.checkpoint.management.web_api.web_services.WebApiEntryPoint.logRequestedCommandInfo:132 `  
  `
  [qtp-828976840-28] - Executing [login] of version 1.1 `  
  `
  DATE TIME,606 ERROR com.checkpoint.management.web_api.utils.WebApiCommandExceptionUtils.getErrorReply:195 `  
  `
  [qtp-828976840-28] - `**Server has thrown GeneralRemoteFault exception errorCode**` `  
  `
  [CP_ERR_COULD_NOT_CONNECT_FWM] errorFamily [null] message `**[Unable to connect to server.
  Please make sure that the server is up and running.]**   
  `
  DATE TIME,607 ERROR com.checkpoint.management.web_api.utils.WebApiCommandExceptionUtils.getErrorReply:219 `  
  `
  [qtp-828976840-28] - com.checkpoint.web_services.faults.GeneralRemoteFault: `**Unable to connect to server.
  Please make sure that the server is up and running.**`
  `

* Show Package Tool fails with: `
  [Expert@HostName]# $MDS_FWDIR/scripts/web_api_show_package.sh -k <PACKAGE NAME>`  
  `
  Exception in thread "main" com.checkpoint.mgmt_api.client.ApiClientRunTimeException: `**Error: failed to get string data**   
  `
  at com.checkpoint.mgmt_api.client.UtilClass.convertToJson(UtilClass.java:54)`  
  `
  at com.checkpoint.mgmt_api.client.ApiClient.apiCall(ApiClient.java:296)`  
  `
  at com.checkpoint.mgmt_api.client.ApiClient.apiCall(ApiClient.java:394)`  
  `
  at com.checkpoint.mgmt_api.client.ApiClient.exit(ApiClient.java:501)`  
  `
  at com.checkpoint.mgmt_api.examples.ShowPackageTool.logoutReportAndExit(ShowPackageTool.java:1548)`  
  `
  at com.checkpoint.mgmt_api.examples.ShowPackageTool.logoutReportAndExit(ShowPackageTool.java:1612)`  
  `


  `

## Cause

The server is configured with maximum heap size (-Xmx) of 256 megabytes which may not be enough for a big number of heavy calls.

## Solution

**Note: This sk is also relevant for R80.20M1. This sk is not relevant for R81.**

This problem was fixed. The fix is included in:

* [Check Point R80.40](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk160736)
* [Jumbo Hotfix Accumulator for R80.30](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk153152) since Take 76
* [Jumbo Hotfix Accumulator for R80.20](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk137592) since Take 117
* [Jumbo Hotfix Accumulator for R80.10](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk116380) since***Take 245***

To enable the fix, follow these steps:

1. Set the environment variables below to improve performance of the Security Management API:

   * Setting the environment variable **`NGM_WEB_API_MAX_MEMORY`** defines the Management API Server maximum Heap size (XMX) to the specified value (in megabytes).
   * Setting the environment variable **`NGM_WEB_API_JRE_64`** to "*1* " allows to run the Security Management API Server on a 64-bit Java device, which allows you to set a maximum Heap Size greater than 4Gb with **`NGM_WEB_API_MAX_MEMORY`** *.*

   <!-- -->

   * To persist the variables between reboots - you must add the line below to */opt/CPshared/5.0/tmp/.CPprofile.sh* for each variable:
     * `_cpprof_add <variable-name> <variable-value> 0 0`

   <!-- -->

   * To apply new configuration - the Security Management API server must be restarted
     * `api restart`

Example of adding persistent variables definitions (JVM 64 bit is enabled and Xmx is set to 4Gb) and applying the changes:

`# echo "_cpprof_add NGM_WEB_API_MAX_MEMORY 4096 0 0" >> /opt/CPshared/5.0/tmp/.CPprofile.sh`

`# echo "_cpprof_add NGM_WEB_API_JRE_64 1 0 0" >> /opt/CPshared/5.0/tmp/.CPprofile.sh`

`# api restart`

<br />

To verify the changes, run these commands:

*#cd /opt/CPshared/5.0/tmp/*

*#grep "_cpprof_add NGM_WEB_API_" .CPprofile.sh*

---

# Agent Instructions

This content is from the Check Point Support Center (https://support.checkpoint.com), the official knowledge base for Check Point cybersecurity products.

## Navigating This Knowledge Base

- **Complete index**: [llms.txt](https://support.checkpoint.com/llms.txt)
- **All SK articles**: [SecureKnowledge Sitemap](https://support.checkpoint.com/sitemaps/secureknowledge-sitemap-index.xml)
- **SK article URL pattern**: `https://support.checkpoint.com/results/sk/{skId}`
- **Markdown responses**: AI bot User-Agents automatically receive `text/markdown` content
