News for hackers. Stuff that matters.
Re:Scala Native v0.1 by sreque on Tuesday March 14, 2017 @11:12AM (#13868096)
The JVM itself doesn't add a huge memory footprint. I remember Charles Nutter of JRuby fame calling it the "20-30 MB memory tax" (see http://blog.headius.com/2008/11/noise-cancelling.html).

A lot of the extra memory usage of Java apps comes from sloppy programming and from depending on lots of heavyweight libraries and frameworks.

Re:Scala Native v0.1 by geodel on Tuesday March 14, 2017 @12:42PM (#13869070)
If you include idiomatic Java programing as part of sloppy programming I also agree with that.

https://www.cs.virginia.edu/kim/publicity/pldi09tutorials/me...

Re:Scala Native v0.1 by sreque on Tuesday March 14, 2017 @02:30PM (#13870150)
Many things pointed out in this article apply to just about every managed language runtime. Implement a TreeSet in any language and you'll see the same overhead from object headers, memory alignment, etc. Java has some oddities that cause it to waste extra memory, but off the top of my head the only I can think of is 16-bit character Strings. Java 9 is supposed to help with that by allowing Strings to internally store utf8 characters.

I do like the slide though showing that people tend to assemble abstractions together and completely lose sight of the performance costs of what they are doing. There's also the fallacy commonly held by many that because someone took the time to write a framework or library, they must have also taken the time to ensure it's optimized well.

Re:Scala Native v0.1 by geodel on Tuesday March 14, 2017 @06:50PM (#13872228)
Go uses quite a bit less memory than Java.

http://benchmarksgame.alioth.debian.org/u64q/go.html

Re:Scala Native v0.1 by SureshG on Wednesday March 15, 2017 @05:08AM (#13874774)
As per the Specjbb benchmark, JDK9 compact strings optimization itself provides,

  * 21% memory footprint reduction
  * 27% less GC
  * 5% throughput improvments
https://www.infoq.com/presentations/java-se-9-cloud - check this presentation for more details.
Re:Scala Native v0.1 by geodel on Wednesday March 15, 2017 @10:46AM (#13876443)
Impressive numbers.
Re:Scala Native v0.1 by pjmlp on Wednesday March 15, 2017 @03:57AM (#13874525)
Due to value types support, which are part of Java 10's roadmap.
Re:Scala Native v0.1 by geodel on Wednesday March 15, 2017 @10:49AM (#13876462)
I'd imagine it will be at least 5 years away when most popular Java software use this feature and java users see the effect of this.