by: Joseph Ottinger on April 04, 2008
One of the issues in moving from the native versions of Python and Ruby to the Java equivalents (Jython and JRuby, for example) is that the memory models change. This probably won't affect most programs, but it's something to consider, and is probably actually a huge win for JRuby and Jython.
For example, Python uses a simple (well, potentially simple!) memory manager based on malloc() and free(), with different object-specific allocators on the same heap (see "Memory Overview" from the Python docs).
Ruby documentation on memory management was hard to find; googling for Ruby and GC yielded the best results, but it looks like Ruby also manages all memory itself, providing garbage collection through ptmalloc (one post from 2007 suggested fixing some heap fragmentation issues by linking to ptmalloc3 instead of ptmalloc2.)
Compared to Java, Ruby and Python memory management seems fairly cryptic (albeit simple). Java virtual machines have different memory management approaches and garbage collection algorithms available, but even the varieties are well-known and documented.
The question, then, revolves around TSS readers: have you noticed any issues caused by the JVM memory managers compared to the native Python and Ruby memory managers? (Groovy and Scala don't suffer from these issues because they run on the JVM in the first place.) Have you noticed any performance improvements related to memory on the JVM?
Even if you haven't, it's probably something to consider when writing Ruby or Python code for the JVM: things that might be necessary to compensate for GC issues in CRuby or CPython (to wit: patches for Rails that change allocation strategies) might not be necessary at all for JVM-based code, and things that leverage the JVM's ability to garbage-collect efficiently (or at least with tuning parameters) might run extremely poorly on CRuby or CPython.

