Highlighted
Absent Member.
Absent Member.
193 views

[archive] Strings passed to C$Java method cannot be Garbage Collected

[Migrated content. Thread originally posted on 17 June 2008]

I am passing a String (PIC X) to a Java method and Java heap memory is increasing until it eventually hits the limit(default 64Mb). I can up the limits but it will occur again so I need to know how to avoid this.

I have used a debugger to find that the Strings passed to my method are not being garbage collected and are remaining on the heap. I am not storing them in anyway on the java side.

Below is the COBOL call. I am talking about a PIC X(1000) or more and calling it over 100,000 times.

Is anyone else having this problem or know a work-around, thanks.

000000 CALL "C$JAVA" USING CJAVA-CALL, IPGLBAL-HANDLE,
000000 "com/company/cobol/IpglbalProcessor",
000000 "execute",
000000 "(X)I",
000000 IPGLBAL-DATA,
000000 IPGLBAL-CALL-SUCCESS
000000 GIVING IPGLBAL-CALL-STATUS.
000000*
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.