Managing OpenSSH user heap

While using OpenSSH, you may encounter situations where the user heap is exhausted when running with a limited amount of storage. This can be caused by certain code paths (for example, file transfers via sftp) in OpenSSH making repeated use of the XL C/C++ runtime library realloc() function. In certain situations, heap fragmentation can occur, causing future requests to allocate user heap to fail and causing OpenSSH commands to fail with the following error message:
"FOTS2050 xrealloc: out of memory"
If you encounter this problem, you can take one of the following actions:
  • Set the _CEE_RUNOPTS="HEAP(,,ANY,FREE)" environment variable when invoking OpenSSH commands. Language Environment will free all unused storage after a call to the XL C/C++ Run-time Library realloc() function, making it unlikely that the user heap will be exhausted during normal use. However, application performance might be affected. For more information about heap tuning, see z/OS Language Environment Programming Reference.
  • Set the _CEE_REALLOC_CONTROL="256K,25" environment variable when invoking OpenSSH commands. Language Environment will optimize heap storage reallocation for OpenSSH. See z/OS XL C/C++ Programming Guide for more information about the _CEE_REALLOC_CONTROL environment variable.
  • Increase the amount of storage available to the processes running OpenSSH commands. For example, use a REGION of 32MB or larger and ensure that the IEFUSI or IEALIMIT exits are not further restricting the region size.