In C ++ im, using the stack distribution where I can, I also keep the data for the same purpose in a single array (Data Driven Programming), etc.
In Java, it will automatically push short live objects onto the stack using Escape Analysis. I would not worry about this if you do not see in the profiler that this is a problem. Even then, it may happen that the profiler does not allow escape analysis to work, and this is not a problem in a real program.
I heard that Java is a "skipped cache generator".
Java has much more links than C ++ or C # code that was written to use structures or objects embedded within objects. What difference does it depend on how sensitive your application is to micro-settings.
, , . , #.
Java ( #) . , . ,
class A { }
class B {
A a = new A();
}
B, A , . Java Eden, . . , 99.9% A B, , . " " Java . .. , .
GC?
JVM OpenJDK/Oracle . .. A B .
Java Data Driven?
, < 1% . , , , .
Java, Java ?
Unsafe . (Chronicle Software) , , , , , 99% . .
. , , -. .
, GC. , , , , , . - , , , . " ", .