|
|
|
|
|
by matt_m
3689 days ago
|
|
The biggest thing compared to C and C++ (or even C# and Go) is probably the lack of user-defined value types. So if you want to create an array of Point2D objects, in Java it will be an array of pointers to heap-allocated objects (each with additional per-object overhead), which is really bad for cache misses, memory consumption, GC pressure etc. C# is a pretty similar language that is popular for game development (with Unity) but unlike Java it supports value types. |
|
How is garbage collection for arrays of value objects solved? Is the whole array gc:d, or what? If an individual element is referenced somewhere the array stays in memory?