4 ms·
> You deploy. You're done. Then you set your memory parameters. Then you tweak them, to make it more performant. Then you increase them some more to make the G
by falcolas 11y ago
> You deploy. You're done.
Then you set your memory parameters. Then you tweak them, to make it more performant. Then you increase them some more to make the GC work less. Then you hook up to the JMX port so you can profile what's going wrong, and identify some XML library as allocating megabytes of strings when it then dumps. Then...
Yeah.
- valertin75 11y agoLooks like you don't like working on projects beyond something that says "Hello World"
- Alphasite_ 11y agoYeah. But you don't have to, you're literally complaint that the user has options. It's not like Go doesn't have a GC either.
- nosequel 11y agoExactly, and Go's GC is years behind the JVM.
- waps 11y ago2 things play in favor of Go on memory usage though: 1) Go is in honeymoon phase. There aren't any 10 million plus lines of code Go codebases. So "Go is not complex". That said in java-land there is often not a very good reason for complexity. I just examined a GWT job scheduling tool and for displaying fields in the UI they had 5 interworking classes - just to avoid manually coding the dialog. In java-land people constantly do that - why ? They had recordbuilders and ui-from-record-builder and ... That said, these days you see people using Go's introspection to create dialogs in javascript - that was a lot more complex still. So while the length of backtraces in Go's crashes has been steadily going up, it seems to be at around 6-8 levels deep these days. I have to say though, I much prefer panics and exceptions over Go's error handling (or as you will come to see it after seeing what "average" programmers do with the errors - Go's error ignoring) This honeymoon also means the amount of idiot-written code in Go is much smaller than in Java. Also, a lot of code in java was written to the previous sets of programmer fancies. Half the libraries you use in a particular project are XML configured, because that was the best practice in 2000-2005 (even still visible in things like android apps), another set is using dependency-injection patterns, another set requires POJOs and uses introspection, and the last set has it's own custom configuration language (I hate gradle, and yes this is because just doing things with cli tools is apparently not done in java-land, I don't care). 2) Go has a better memory model than Java. Because you can nil out every java object, every java object has to be a pointer. So initializing an object that contains 5 other objects requires 6 heap allocations and constructor invocations - minimum. After construction the GC has a new tree of 6 objects to walk on every invocation. This is not the case in Go (uninitialized non-pointer objects aren't nil, you only use pointers where you actually need them), and results in much more compact memory. I see it as a flaw in java these days.
- threeseed 11y agoAnd the biggest joke is that when you tweak the default settings you often end up making it worse. The JVM has generally excellent performance with the defaults.
- Skinney 11y agoSetting memory parameters and tweaking them would be similar to deciding what compilation flags to use when compiling your program. I also much prefer profiling over JMX than re-compiling the application with the profile flag activated and re-deploying.
- mavelikara 11y agoThe ability to tune GC and availability of monitoring solutions are things I consider as big pluses for deploying on the JVM. I would love to have a GC which tunes itself to accommodate the workload. On the JVM, G1 is a step in the right direction. How does Go's GC work in this regard - does it auto-tune itself? Also, how are Go programs monitored in production? Are there tools like AppDynamics, NewRelic, JConsole or similar APM/telemetry solutions available to monitor Go applications?
- vithlani 11y agoAnd this is something that never gets discussed by the hipsters -- the solidity built into the very foundations of the JVM platform. No, they just wanna write quick Fibonnaci generators in Node and put it up as a Gist.