Skip to main content

While trying to execute the following code, call to javax.resource.Interaction.execute(iSpec, iRec, oRec) with its parameters depicted as the below raises java.lang.OutOfMemoryError: java heap space. What would be suggested by this error?

ix = con.createInteraction();

iSpec.setArgument(0, com.microfocus.cobol.RuntimeProperties.By_REFERENCE);

javax.resource.cci.IndexedRecord iRec = rf.createIndexedRecord("some_name");

javax.resource.cci.IndexedRecord oRec = rf.createIndexedRecord("some_name");

Pointer ptr = new Pointer("some text", "MS932");

iRec.add(ptr);

ix.execute(iSpec, iRec, oRec); // -> java.lang.OutOfMemoryError: java heap space is thrown upon execution.

While trying to execute the following code, call to javax.resource.Interaction.execute(iSpec, iRec, oRec) with its parameters depicted as the below raises java.lang.OutOfMemoryError: java heap space. What would be suggested by this error?

ix = con.createInteraction();

iSpec.setArgument(0, com.microfocus.cobol.RuntimeProperties.By_REFERENCE);

javax.resource.cci.IndexedRecord iRec = rf.createIndexedRecord("some_name");

javax.resource.cci.IndexedRecord oRec = rf.createIndexedRecord("some_name");

Pointer ptr = new Pointer("some text", "MS932");

iRec.add(ptr);

ix.execute(iSpec, iRec, oRec); // -> java.lang.OutOfMemoryError: java heap space is thrown upon execution.

In the example above, I use a Pointer in order to transfer a string with a specified encoding, but how would a string not wrapped in a Pointer gets handled before it is passed to a COBOL program?  Will the implementation perform "some strong".getBytes() ?  Will passing a Pointer("some text") without any encoding specified gives the same result?