5 ms·
Given a specific machine with a set amount of cpu, ram, and io bandwidth, I find I can easily do more on that machine with go than java. Also, try running mult
by tomohawk 10y ago
Given a specific machine with a set amount of cpu, ram, and io bandwidth, I find I can easily do more on that machine with go than java.
Also, try running multiple java processes on a machine as opposed to multiple go programs.
- weberc2 10y agoSo could I. I imagine a Java aficionado would say the opposite. Like I said, different ways to think about the problem.
- donatj 10y agoTo the posters point about running multiple Java aaps on a single machine, I think ram is the real issue. Java makes in my experience far less frugal use of it. I've seen Java applications eat hundreds of mbs of ram rewritten in Go using 1-2 mb.
- vinceyuan 10y agoExactly. Go app uses much less RAM than Java app.
- weberc2 10y agoEvery time I hear this conversation play out, the Java folks point out that the GC is highly tunable/pluggable, so you can shift some levers and get lower memory consumption in exchange for more frequent collections. I'm not a GC expert, so I'm just repeating what I've heard.
- mcguire 10y agoThis is true. The Java GC (and the whole VM) is one of thr most impressive pieces of software in existence. There are several GCs available, they're tunable, and they support monitoring better than any other I've seen. No GC I know is happy without a heap several times larger than the program's requirements. OTOH, Java programs tend to be built using frameworks that soak up memory like crazy. So there's that.
- FlyingPiranhas 10y agoI believe that Go's GC currently bounds heap memory usage to 2x the actual usage (worst case).
- nerdwaller 10y agoI tend to agree from the naive Java approach, but with Java and multiple processes on the same machine they really should share a single JVM. Many people end up having one JVM per process. But the go runtime is less greedy and supports that logical thinking much more obviously.