Udayan Kumar wrote:Yes we do have a return type (custom java object) which includes some other objects part of the program flow.
Is the object returned is one of the many objects you create while your application processing. If yes, then is the returned object stored in a class level variable or is long lived?
See the idea is the following:
If any object instance is returned from a method it has a potential of living longer than it would have otherwise done. The reason being that it otherwise would have been a local variable and local variables are unreferenced as soon as you exit the scope.
However, when you return this object from the method you might potentially have a reference to it which is not a local variable or even if it is, it may have a bigger scope.
So, you need to check your code to find out whether any of the returned objects can potentially be referenced for a longer time than required.
Udayan Kumar wrote:
The very first steps in the routine is all objects used as part of processing as well output objects are initialized to null and then based on the input elements the program proceeds.
This may not be sufficient as you return one of the output objects that might be referred somewhere else. However, as i have not seen your code, my interpretation could be wrong.