At least the Main class is loaded, and the AppClassLoader responsible for loading main is also instantiated. So there must still be some objects generated along with main. The difference between Java and native languages such as C++/C is that it is difficult to ensure that what you see is what you get....
I added some code to prove that some objects were generated before main...
import java.util.Objects;
public class MyTest{
static{
System.out.println(MyTest.class.getClassLoader().getClass().getName());
}
public static void main(String[] args) {
}
}
Since I am not very familiar with the JVM memory pool model, I cannot say whether some memory pool objects will be generated during this process.
At least the Main class is loaded, and the AppClassLoader responsible for loading main is also instantiated. So there must still be some objects generated along with main. The difference between Java and native languages such as C++/C is that it is difficult to ensure that what you see is what you get....
I added some code to prove that some objects were generated before main...
Since I am not very familiar with the JVM memory pool model, I cannot say whether some memory pool objects will be generated during this process.