Mechanisms for Allocating Immortal Memory

The RTSJ supports five mechanisms for allocating objects in immortal memory:

  • implicit. The Java runtime environment may determine that an object must be unexceptionally referenceable from anywhere. It turns out that only immortal memory meets that requirement. A high-quality implementation of the RTSJ may employ a “trick”—like memory objects that are supervised by a special reference-counting garbage collector—to handle some of these objects, but they must behave as if they were immortal.

  • newInstance. Any thread can get a reference to the immortal memory object and use its newInstance methods to allocate memory. This is a good technique for code that wants to allocate just one immortal object. It may ...

Get Real-Time Java™ Platform Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.