Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

jco memory leak

Hello all,

I am currently using JCO 2.1.6 oN HP UX 11i to connect to a SAP WAS 6.40.

I see that my application is leaking in memory. After quite some troubleshooting, I managed to build a testbed showing that it seems that it is leaking in the memory DATA region. This is usually happenning when there is a leak in a JNI layer.

Did anyone experience a similar issue? Is there a more recent SL librray than the one provided with 2.1.6.

Also when the program is starting I am seeing the following issue.

/usr/lib/ Can't find path for shared library:

/usr/lib/ No such file or directory

The mapping from JCO object to java object is done using a program based on the principle of "sap2java".

An extract of my testbed is

public DataWrapper execute(String packageName, String functionName, Object inputParams)

throws JCO.Exception, IllegalArgumentException, MappingException {

IFunctionTemplate functionTemplate = null;

JCO.Function function = null;

JCO.ParameterList input = null;

String fName = functionName.trim().toUpperCase();

JCO.Client connection = null;

try {

connection = JCO.getClient("mypool", true);

functionTemplate = getFunctionTemplate(fName, connection);

JCO.Repository repository = new JCO.Repository("SID","mypool");

functionTemplate = repository.getFunctionTemplate(functionName);

// don't cache the function!!! (see documentation)

function = functionTemplate.getFunction();

if (inputParams != null) {

input = function.getImportParameterList();

setInput(input, inputParams);



  • if ( tableParams != null && tableParams.length > 0 ){

  • JCO.ParameterList tables = function.getTableParameterList();

  • setTables(tables, tableParams); }


// make the call to ABAP. All input parameter are already set

// in the function.


return handleResponse(function, packageName);


finally {

if (connection!=null) {



functionTemplate = null;

function = null;

input = null;

connection = null;



Not what you were looking for? View more on this topic or Ask a question