Monitoring memory in Service Manager processes

The Service Manager process embeds a Java Virtual Machine (JVM) so that the heap memory provided by the operating system for any process is partitioned into a Java Heap and a Native Heap. The Service Manager process self–monitors these heaps and takes action to prevent a crash.

During startup of a Service Manager process, immediately after the JVM is created, a memory monitor thread is started, which will poll for a low memory condition every 15 seconds. On every iteration, the memory monitoring thread fetches the current usage of java heap (all platforms) and native heap (Windows only) and set the process global flags lowMemoryOnJava and lowMemoryOnNative when the usage exceeds 90% of allocated memory in that category. These flags are unset again when the usage of memory drops below 70%.

To prevent server crashes due to low available heap memory and to avoid disrupting users who are logged on to a Service Manager process, the servletcontainer takes the following actions when the low memory flags are set:

  • Writes warning messages to sm.log.
  • Notifies LoadBalancer not to send that servlet any new client connections.
  • Denies new client sessions (Windows client, web client or web services client) for that servlet. They are sent to another one.
  • Does not allow existing clients to open new tabs. However, they can trade the existing tabs for new ones. For example, if you close two tabs, you will be allowed to open two new tabs. If you cannot operate without opening any new tabs you need to logoff and login again.

Normal processing is resumed when the heap usage drops below 70%. The servletcontainer takes the following actions when the low memory flags are unset.

  • Writes Info messages to the sm.log file indicating normal memory usage.
  • Notifies LoadBalancer to resume sending of new client connections.

Related topics

Monitoring native heap and Java heap memory
Logging memory monitoring

Related topics

Servlet parameters
Debugging parameters
Parameter: log4jDebug
Parameter: memorypollinterval