OT: Minecraft death by GC

Paulo Pinto via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 21 14:33:42 PDT 2014


On Tuesday, 21 October 2014 at 07:37:06 UTC, Kapps wrote:
> "Maybe the biggest and the ugliest problem is the memory 
> allocation. Currently the game allocates (and throws away 
> immediately) 50 MB/sec when standing still and up to 200 MB/sec 
> when moving. That is just crazy."
>
> Wonder how much better that would be if Java had proper value 
> types. The idea of allocating on the heap for every single 
> Vector3f makes me sad.

Well, some JIT compilers do stack allocation via escape analysis, 
which you can check with something like JITWatch.

For first class support, it is planned for Java 9, but it might 
only really come in Java 10.

--
Paulo


More information about the Digitalmars-d mailing list