Unix server application error: "exec(): 0509-036 Cannot load program ABC1 because of the following errors: 0509-026 System error: There is not enough memory available now."

Document ID : KB000025366
Last Modified Date : 14/02/2018
Show Technical Document Details

Problem:

Trying to start a Unix server application gives the error: "exec(): 0509-036 Cannot load program ABC1 because of the following errors: 0509-026 System error: There is not enough memory available now."

 

Environment:

Unix platforms

 

Resolution:

The error message "0509-026 System error: There is not enough memory available now" can be caused by requests which would exceed the available memory in many different situations, e.g. stack memory, or requesting >2Gb application memory from a 32-bit program. However in this case it is referring to an attempt to load a program which would cause the size of the global shared segment to be exceeded. This is where shared objects are loaded and has a hard set limit of 256Mb, the application executables had a very large number (>100) of operations libraries linked into them as shared libraries.

Because of the interdependent nature of the libraries in use reducing the number of libraries that each load module linked in was not practical.

Fortunately on AIX it is possible to define a user defined Named Shared Library Areas and thus load the application shared libraries into separate areas and so away from the Global Shared Segment.

The feature is described at the following URL:
http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/com.ibm.aix.genprogc/doc/genprogc/named_shared_lib.htm

In essence to define the area you simply need to declare an environmental variable LDR_CNTRL=NAMEDSHLIB and then give that a value before starting the application.

In this scenario the application was being run under the Transaction Enabler and so the variable needed to be declared in the environment that starts the aefad, so that it's value would be inherited but all the spawned application load modules e.g.

$ export LDR_CNTRL=NAMEDSHLIB=AREA1
$ aefad -i 2333 -a 50 -q1

If it is required to run separate development and UAT environments on the same machine, this can be achieved by simply declaring a unique LDR_CNTRL variable value for each aefad that is started.

In addition to above, in order to remove any unused modules from memory after a TE shutdown, a call to the slibclean command can be added to the TE shutdown procedure after stopping the aefad.