4 ms·
Java still eats like 5x ram compared to node, Java tools are slow, Java frameworks are gargantuan, even those claiming "lean". Java is fine if you don't care a
by vbezhenar 5y ago
Java still eats like 5x ram compared to node, Java tools are slow, Java frameworks are gargantuan, even those claiming "lean".
Java is fine if you don't care about RAM and start time, though.
- sandGorgon 5y agohttps://quarkus.io/guides/building-native-image https://quarkus.io/guides/building-native-image You should try Quarkus. It is a production framework built by Redhat. It uses Java-GraalVM under the cover to compile your entire webapp to an executable (like golang does). It's just as fast. Java is the highest performance and most tuned VM there is. I think you're really thinking of java from a long time ago, if ur thinking this
- geodel 5y agoAh that Supersonic-Subatomic-Java. Whatever Redhat lacks in quality side in Java frameworks, they more than compensate with corny marketing taglines.
- rbanffy 5y ago> Java is the highest performance and most tuned VM there is. Not defending the opposite argument, but V8 is also pretty impressive. It's rooted in work done for Smalltalk long before JavaScript was a thing.
- MaxBarraclough 5y ago> It's rooted in work done for Smalltalk long before JavaScript was a thing. The same is true of HotSpot. https://en.wikipedia.org/wiki/HotSpot_(virtual_machine)#History https://en.wikipedia.org/wiki/HotSpot_(virtual_machine)#Hist...
- sverhagen 5y agoIf you use gargantuan Java frameworks, you'll use a lot of RAM. Just don't do that. With Spring Boot and similar frameworks, the RAM usage is really just very modest. I'll give you startup times, since I am not a believer in Quarkus and Graal. And I wouldn't use Java for a serverless function that needs to spin up and respond quickly. But for a typical (blue/green-deployed) application in my world, startup time is still only a few seconds, which is fine for many applications. And I am not settling for "fine", just saying that the startup time isn't a big consideration, against a lot of things the Java (or Spring, in my case) ecosystem offers me.
- vips7L 5y agoStartup time is fine.. just don't use spring where it has to read every class at runtime to determine what to inject.
- geodel 5y agoWell that's the Spring's great feature: To convert as many compile time errors in to runtime errors as possible.
- jpgvm 5y agoTo be fair there is the new Kotlin based wiring API which avoids that with the caveat you need to instantiate everything manually etc. Which is probably a decent tradeoff for some folks.
- vips7L 5y agoThere’s other alternatives like Avaje Inject and Quarkus which uses the same annotations but does the injection generation at compile time.
- nogridbag 5y agoCare to share more thoughts on Quarkus? I'm evaluating it for an upcoming app. From my limited reading it can be used with and without Graal.
- sverhagen 5y agoSee my sibling comment: my fears are irrational.
- EdwardDiego 5y agoMy favourite bit of Quarkus is the same as my favourite bit of Micronaut - DI is compile time.
- kitd 5y ago
- Skinney 5y agoJavalin is _very_ lightweight, and starts up fast. Use the framework that best suits your requirements. Also, Java is working on reducing ram usage: https://openjdk.java.net/projects/lilliput/ https://openjdk.java.net/projects/lilliput/
- dzonga 5y agothere's Helidon: https://helidon.io/ https://helidon.io/ as well from Oracle. though at the moment, I'm using Javalin.
- vbezhenar 5y agoI thought so too. And wrote simple web service using Helidon SE. It eats 300+ MB of RAM. I spend some time trying to optimize GC and all that stuff. Similar node service would eat 30 MB of RAM. May be Graal would save us all. Until then Java is beyond salvation.
- kaba0 5y agoOther than a very very niche usecase, I really don’t see how eating 300 MB of RAM is so problematic when we quite literally have servers with terabytes of RAM. Yeah java can be configured to run GC all the time and target <100M of ram, but it rather runs the GC only seldom (jvm is actually one of the most energy efficient runtimed languages out there!) and trades memory usage to throughput.
- vbezhenar 5y agoBecause in the cloud you're paying hefty price for every MB of RAM. For example with Jelastic you have 128 MB per cloudlet. And it's 2x difference between 120 MB and 130 MB. And with dedicated servers I don't have terabytes of RAM, I have two server with 24 GB each. And no, you can't configure Java to target <100 MB of RAM. I configured it with -Xmx64m and it still eats around 300 MB. Java just fat and you can't do nothing about it at this time.
- kaba0 5y agoOr you care about actual performance of the system?