On Jul 6, 3:56*am, Alex J <vstren...@gmail.com> wrote:
>...
> Keeping in mind the difference C vs Java implementation I can only
> speculate on how muchlockfunctionalitycontributes to that overhead.
BTW, if someone is still interested in the overhead:
$ANDROID_SOURCES/dalvik/vm/oo/Object.h introduces the following layout
behind the Object class:
typedef struct Object {
/* ptr to class object */
ClassObject* clazz;
/*
* A word containing either a "thin" lock or a "fat" monitor. See
* the comments in Sync.c for a description of its layout.
*/
u4 lock;
} Object;
So the memory overhead is known (and it is +4 bytes for all the
Objects no matter if they ever locked or not).
As for HotSpot JVM it is not that easy to find the distinctive layout
of the Object class.
>
> [snip]
> > --
> > Lew
> > Honi soit qui mal y pense.http://upload.wikimedia.org/wikipedi.../c/cf/Friz.jpg