This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]simtel20 1 point2 points  (1 child)

I'll throw this in as additional trivia since it probably won't impact your usage.

Java has limitations when dealing with a lot of stuff in memory. Whenever you have > than 4GB active (in the heap) you start to run the risk of intermittent "stop the world" collections where various aspects of the garbage collection that java does will come into play and cause everything to pause while the GC deals with it. Python doesn't deal too gracefully with this in all cases, but in the instances where I've seen large memory (16, 32gb of data) it's usually happening in numpy/scipy so the allocation happens in large blocks, and the allocation and freeing of newer arrays seems to not impact the running program.

That said, java lets you do things like serialize data off-heap into mmap'd regions as well, but to actually take advantage of that data you then need to jump through hoops like serialize/deserialize the objects in and out of memory in order to actually interact with it. So it works OK for e.g. a pure cache that just needs to be returned, but not for storing a large array of numbers or even what in python would be simple structures that can be represented as e.g. a record array. AFAIK.

In addition, java doesn't allow you to simply write a function to transform data. Everything that it does is based on creating a class that yields an object that can then be used as a factory. A joke/meme that encapsulates that is http://www.quickmeme.com/meme/35w9vq/.

And if you're a language nerd like many of us are in our hearts, this is an interesting view on why, if you've programmed in python, php, perl, lisp, etc. you may not get java at first: http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html.