ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Is it necessary to free Java objects that I have created from RPG?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it necessary to free Java objects that I have created from RPG?

    Hi All,

    I am prototyping and calling some java methods from RPG ILE program. The CLASSPATH is set properly and the program runs fine.

    Recently I read an article in IBM site which said "When RPG calls Java using RPG's EXTPROC(*JAVA) support, any objects that are created by Java calls must be explicitly freed by the RPG code. Java has no way of knowing when the RPG program is done with the objects.
    You can clean them up one at a time by calling the JNI function DeleteLocalRef or you can clean up many at once by calling the JNI function PushLocalFrame before you start using Java and then calling PopLocalFrame when you are done."

    But I haven't used any of these JNI functions to clean up the objects created by Java calls. I have just prototyped all java methods and then called them. But my program is running fine. Is it possible that my code may stop working normally because I haven't put code to clean up the objects created by Java calls?


    Thanks,
    Subha.
Working...
X