You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Apache Wiki <wi...@apache.org> on 2005/05/24 16:43:01 UTC

[Harmony Wiki] Update of "JVM Implementation Ideas" by ArchieCobbs

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Harmony Wiki" for change notification.

The following page has been changed by ArchieCobbs:
http://wiki.apache.org/harmony/JVM_Implementation_Ideas

New page:
=== JVM Implementation Ideas ===

This is a list of various useful design ideas and implementation
tricks that may be desirable to include in Harmony.

= Per-class loader memory areas =

* Idea: class loaders and all their defined classes are unloaded
all at once. Memory is allocated and not freed until that happens,
so allocation behavior is stack-like. Instead of using the more
general and therefore costly malloc() or the Java heap for
class loader specific memory, use a lighter weight, stack like
memory subsystem.
* Advantages: more efficient, makes class loader unloading easier
* Disadvantages: none
* Origin: SableVM

= Bi-directional object layout =

* Idea: let objects' primitive fields grow upward from the object
head and let reference fields grow downward from the object head.
Object pointers pointing to objects themselves containing object
references therefore point into the middle of the object's memory
area.
* Advantages: all object references are contiguous, which makes
following these references during garbage collection, etc. easier
and simpler.
* Disadvantages: object head (lockword, vtable pointer, etc)
is not necessarily at the beginning of an object's memory area,
which can mean extra work to find the head when iterating through
the heap e.g. during mark/sweep GC.
* Origin: SableVM

= Spinless thin-locks =

* Idea: compare-and-swap instruction used to grab an object lock
in the common case of no contention, otherwise fall back to mutexes.
* Advantages: very efficient
* Disadvantages: some assembly required
* Origin: lots of people. SableVM has a nice version of this algorithm.