I asked a question at : Any practical difference in the use of Java's static method main?
But didn't quite get the answer, so I want to put it another way, see if the question is more clear this time :
I have a class A with a static main method :
public class Class_A
{
...
public static void main(String[] args)
{
...
}
}
I also have a class B that runs non-stop 24 hours a day in the background and on every hour, it would start Class_A automatically. Class_A uses a lot of memory and is quite huge in size, so when it's finished, I hope all the memories are recycled, I'm doing my part to make sure that happens, but sometimes somewhere in the program there might be a memory leak, so would it be better for Class_B to call :
new Class_A().main(new String[]{});
So it's memory will be better recycled after it's finished ? Or is it better to call : Class_A.main(new String[]{}) ?