How high are he memory costs of polymorphic inline caches?

Jochen Theodorou blackdrag at
Thu Aug 21 10:31:03 UTC 2014

Am 21.08.2014 04:16, schrieb Mark Roos:
> example about a simple Groovy program being able to run in about 40MB
> memory, but needing quite a bit more with indy. Since I can observe the
> memory drain with a small program already, and since I know that handles
> are not that reusable yet...
> I see about the same, about 2X larger in jvm than native Smalltalk.  But
> there
> are differences.  Rtalk is pure 64 bit including all integers,  all
> integers are
> boxed ( native ST uses tagged pointers and is 31 bit) and all of the
> compiled
> code never dropped vs the native ST had a limited code cache ( 1M).  If
> I drop
> the code then Hotspot does not do a good job jitting.  But then I now have
> multi gigs of available memory vs 200 Megs usable before.
> And it is about 2X faster without the multicore advantage.

Well, what I compared back then was not native, both are Groovy ad 
therefore on the JVM. Only one version uses our old call site caching 
implementation, which resorts to reflection and runtime class generation 
  and the other is based on indy. The non-indy version has even more 
boxing and Object[] generation than the indy version. Funny thing was 
though that I also required double the amount of memory... of course 
garbage collection was happening as well.

But as I said, that test might be outdated. It might be less now, but 
given the amount of memory a small class and its instance require and 
given lambda forms it is unlikely for me that the lambda form version 
takes less memory.

bye Jochen

Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit

More information about the mlvm-dev mailing list