> I think the realm where the JVM can potentially beat C++ is, funnily, work that requires a lot of memory. The thing that the JVM memory model has going for it is that heap allocations are relatively cheap compared to heap allocations in C++. If you have a ton of tiny short lived object allocations then the JVM will do a great job at managing them for you.
Except C++ also has many other options besides malloc() each of these individual objects.
Except C++ also has many other options besides malloc() each of these individual objects.