3 ms·
But you can use 99% of C/C++ applications without any compiler flag trickery. My experience is not that you can run 99% of Java applications without running ou
by usr1106 6y ago
But you can use 99% of C/C++ applications without any compiler flag trickery.
My experience is not that you can run 99% of Java applications without running out of memory or something like that. That's why I avoid Java these days when I have the option. I don't think things would have changed much that much in recent years, making my experience no longer valid.
- somehnguy 6y ago??? I've been using Java daily for years at this point. The only time I've had that sort of issue is when the program I was writing dealt with large files in memory, and it was solved with a simple -Xmx16G.
- usr1106 6y agoHah, I still use laptops with 2G and 4G :) They work perfectly fine when you know what you are doing. But running Java with 16GB pool does not fall in that category. The same holds for small cloud instances. Admittedly even with a C program the size of a problem requiring 16GB might not run well in a 2GB machine, but the fact remains that Java applications are often much more memory hungry than comparable C/C++ implementations. And if you have the memory they will just use it without any Xmx. That sounds really like computing in the 1960/70s that you need to allocate memory in advance. (I'm old enough to have seen such stuff, although not when it was new.)
- deleted 6y ago[deleted]
- winkeltripel 6y agoJava may be more memory hungry, but 4gb of memory hasn't been enough for a wide array of tasks for about a decade now.
- pron 6y agoIf your experience was with Java 8, then things have changed radically since then.
- usr1106 6y ago9 might have been the last one I have used. I definitely have used 8. (And certainly 1.2, 1.3 etc, but those were different times...) Is there a concept that the search machine would find, which has brought the radical change you mention?
- pjmlp 6y agoComplete replacement of GC algorithms for start, with G1, ZGC and Shenodah. Regarding OpenJDK, other JVM vendors have improvements of their own.
- pron 6y agoNo, just lots of different things. G1 has had ~700 improvements since JDK 8 and is now very different: https://archive.fosdem.org/2020/schedule/event/g1/ https://archive.fosdem.org/2020/schedule/event/g1/ ZGC, the low-latency collector (which gives a ~1-2ms max pause times on heaps of up to 16TB in JDK 16) was introduced in 11 and made production-ready in 15. In general, the way the GCs work is just very different from 8. Plus, there have been lots of improvements to CDS and startup time in general due to how the VM loads classes and initialises data (~30 ms to run Hello, World on a cold VM in 15) -- https://cl4es.github.io/2019/11/20/OpenJDK-Startup-Update.html https://cl4es.github.io/2019/11/20/OpenJDK-Startup-Update.ht..., https://twitter.com/cl4es/status/1311335253139771393 https://twitter.com/cl4es/status/1311335253139771393, https://www.morling.dev/blog/building-class-data-sharing-archives-with-apache-maven/ https://www.morling.dev/blog/building-class-data-sharing-arc... And, of course, now everything lies on top of the module system.