6 ms·
Hmm. Just checked memory use on some services we run on Go, Node, and Java. I'm not part of the Java team but results: Go: 40M Node: 64M Java: 4GB Any Jav
by base698 8y ago
Hmm. Just checked memory use on some services we run on Go, Node, and Java. I'm not part of the Java team but results:
Go: 40M
Node: 64M
Java: 4GB
Any Java service I've seen in production has similar numbers. Coupled with the incredible startup time it's hard for me to see why you'd pick it in 2018.
- levosmetalo 8y agoIf you tell your Java application server "here you have 4GB, use it as you wish" it will happily comply and trade memory for performance. In most of the cases it's just a matter of setting a few Java runtime startup parameters.
- sirk390 8y agoIt's disrespectful to take 4GB if you don't need it. This should never be the default...
- boobsbr 8y agoRead the comment again: > If you tell your Java application server "here you have 4GB, use it as you wish"
- bloomthrowaway 8y agoIt's the default because in any garbage collected language you can delay taking out the trash as long as you want... as long as you have memory. The most efficient thing to do is never run the collector at all. JS does frequent GC cycles because its unacceptable to let a webpage eat all the ram. Not sure why Go collects so frequently. Java's default IMO is the most reasonable of the three. If you have a server with 4gb the best choice is to let the garbage collector use all of it
- fastbmk 8y agoJVM uses as much memory as you allow. Use `-Xmx39m` to beat Golang.
- base698 8y agoYeah, but they all seem to need high mem amounts or they OOMException.
- fastbmk 8y agoWell, it may also be a bad code written by amateurs which use memory inefficiently.
- sheeshkebab 8y agoMy guess is that it won’t work with less than 1GB bc of spring boot, hibernate and all the rest of Java enterprise “microservice” goodness.
- boobsbr 8y ago> My guess So you actually haven't tried to run an application with those libraries, and you don't even know what libraries that particular application is using, and here you are speculating about something you don't know and/or understand.
- bloomthrowaway 8y agoI've used Spring and he's probably right :) . But there's better choices these days. Any Spring micro-services out there are probably by a team that knew Spring well and didn't want to learn a more suitable framework
- jackpeterfletch 8y agoWhats different about the equivalent libraries in other languages?
- bloomthrowaway 8y agoSpring is huge... The closest competitor might be Rails
- 8y ago
- akerro 8y ago>Go: 40M Node: 64M Java: 4GB This benchmark is completely useless unless you have 3 identical servers with identical algorithms using identical API and models with identical work load. so... why would you waste time writing them? Also, these [1] benchmarks which are more reliable, because we know what servers they're run on and we can inspect source code, unless, of source, you can prove your statement. [1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/javascript.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- ataturk 8y agoWho the heck wrote the Java service you are referencing? Anectdotal, at best, or the result of poor development effort. Incredible startup time? Is it Websphere-based, perhaps? Are you comparines apples to apples? I mean, I haven't seen many Node-based or Go based services that do very much in comparison to what our Java based ones handle--pulling in mountains of data from multiple sources in Cassandra, streaming it through Kafka to make it available to a cluster of processing nodes as well as making it available via our APIs. Are your Go service comparably sophisticated? There is no way my company could have gotten better results using Node, we have played around with Express and wanted to try writing some microservices using Javascript. Basically, it sucked big time. The speed wasn't there, the tooling wasn't there. And Go sounds great, and maybe it will be in timne, but the infrastructure, tooling, and libraries just aren't that evolved yet. With Java, you can get things done and have reliable services that run without drama. Also, unlike Node and Go, you can easily hire people who can work on the code, write tests, and support the deployment and monitoring of the system. If I chose to write the same thing in Go and anything went wrong, I'm looking at getting fired, and rightly so since so much of what we produce has implications beyond the language/runtime used.