I have a function that works for a long time, and I declare and assign an object inside this function. Now, from what I think I know, this object will live in memory at least until this function is launched, and after that it will be available for garbage collection if no other object refers to it . Now I want this object to be available for garbage collection before even the function is completed. In the encoder:
public void foo(){
String title;
Object goo=getObject();
if(goo!=null)title=goo.getString("title");
for(int i=0;i <1000000;i++)
{
}
}
, for
. - , . , ?