Skip to main content

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

  • June 17, 2012
  • 0 replies
  • 0 views

[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 replies

Be the first to reply!