Live Collaboration Server Memory Management

By default, the 3DSpace Service uses the memory management facilities of each platform on which it is supported.

Unfortunately, these default memory management scheme's are generally best suited for single-threaded applications. They have no provisions for guarding memory or monitoring its usage on a per thread basis. They also offer no help in diagnosing memory related problems and so are not designed for use on a server.

See Also
Load Runner Example
Memory Manager Configuration Settings
Memory Manager Error and Log Messages

A more sophisticated memory management tool is provided with 3DSpace (a shared library: mxmemory.dll on Windows, libmxmemory.so on Linux) that may be configured so that memory related problems in the server are detected. The memory manager also provides a way of exiting gracefully in the event of catastrophic memory-related failure, with enough information to diagnose the problem.

Specifically, the memory manager can:

  • Limit the amount of memory 3DSpace will ever consume.
  • Track memory consumption of the server over time on a per thread (or per operation) basis. This tracking includes detection of memory leaks.
  • Provide a high water mark for memory usage. When memory usage exceeds this mark, diagnostic information is available to determine the process that is using excessive memory.

One of the most critical things the memory manager does is handle out-of-memory conditions. In order to manage this, upon startup/initialization, a 1MB "panic" memory reserve is allocated by the memory manager. Then, if an out-of-memory condition occurs:

  • Memory associated with the MX_MEMORY_KEEP_LIMIT setting is freed, and the operation is retried. If successful, a warning is output and the server continues.
  • If the out-of-memory condition persists (that is, there are no KEEP blocks to free and/or the retry fails) the panic reserve is used to output all available diagnostic information and exit the server.

The most important aspect of this handling is that when a memory related failure occurs, information is always posted to the server log files to clearly indicate the source of the problem.