News for hackers. Stuff that matters.
Re:Building Memory-efficient Java Applications by DanielRibeiro on Thursday February 02, 2012 @04:10AM (#3542028)
Very nice presentation. However much of this can be actually discovered and felt first hand just by playing with profilers that support memory profiling (such as yourkit[1]).

After a few hours playing with it, you will never forget the precious lessons on this presentation.

[1] http://www.yourkit.com/

Re:Building Memory-efficient Java Applications by NSMeta on Thursday February 02, 2012 @05:30AM (#3542175)
This is probably an 'apple and oranges' type of question, but I haven't used Erlang, nor Java to build large applications.

Does anyone know how Erlang compares to Java in regards to memory usage/performance?

Re:Building Memory-efficient Java Applications by jamii on Thursday February 02, 2012 @07:59AM (#3542493)
Per object overhead in functional languages is usually lower since polymorphism is handled at the function level rather than the data level. You don't have to store class pointers etc, just the raw data and probably a type tag.

I can't find a reference for erlang's representation but I believe it has only a little more overhead than ocaml which is described here - http://rwmj.wordpress.com/2009/08/04/ocaml-internals/

Re:Building Memory-efficient Java Applications by NSMeta on Thursday February 02, 2012 @01:17PM (#3543827)
I know I should thank you by up voting. But also, just want to say that the guide was a very interesting and insightful read.
Re:Building Memory-efficient Java Applications by gtani on Thursday February 02, 2012 @08:48AM (#3542639)
using their official docs

http://erlang.org/doc/efficiency_guide/advanced.html#9

(I haven't tried this:

    erts_debug:flat_size(dict:new()).
http://stackoverflow.com/questions/1964015/erlang-what-is-mo...
Re:Building Memory-efficient Java Applications by abecedarius on Thursday February 02, 2012 @05:52AM (#3542212)
Per-object overhead is generally more reasonable.
Re:Building Memory-efficient Java Applications by thesz on Thursday February 02, 2012 @06:03AM (#3542228)
You can have a whole Erlang process for a price of (roughly) 100 Java objects.
Re:Building Memory-efficient Java Applications by joshhart on Thursday February 02, 2012 @12:44PM (#3543710)
For those of you who may not be familiar with them, using http://fastutil.dsi.unimi.it/ collections instead of Java collections is essentially the work-around for most things you'll use. Fastutil has custom classes that remove the pointer overhead associated with storing primitives. Unfortunately, Java really falls apart at the primitives aren't objects thing when it comes to performance.
Re:Building Memory-efficient Java Applications by insom on Thursday February 02, 2012 @07:50AM (#3542474)
It just goes to show that whatever language you use, you need to understand what the abstractions are doing: what bytes are really going where?
Re:Building Memory-efficient Java Applications by dasmoth on Thursday February 02, 2012 @10:31AM (#3543030)
Some (not all) of these cases would be helped massively if the JVM gained an equivalent of the fixnum/flonum types from the LISP world. This has been proposed kind-of seriously in the past, e.g.:

http://blogs.oracle.com/jrose/entry/fixnums_in_the_vm

Has anyone seen anything more recent?

Re:Building Memory-efficient Java Applications by jesperhh on Thursday February 02, 2012 @05:18AM (#3542146)
Does anyone know of a similar study of memory efficiency in C# (or the CLR in general)?
Re:Building Memory-efficient Java Applications by dikanggu on Thursday February 02, 2012 @04:06AM (#3542023)
Cool! Very good explanations.
Re:Building Memory-efficient Java Applications by morsch on Thursday February 02, 2012 @05:30AM (#3542174)
TreeMap<Double, Double>, 100 entries, 8.6 kB, 82% overhead

Man, that's just annoying.

Re:Building Memory-efficient Java Applications by sjwright on Thursday February 02, 2012 @08:07AM (#3542511)
That's great, but perhaps they should teach some of this to their colleagues at IBM first.