The Allocation Regimes

The RTSJ defines two new types of memory that are free from garbage collection:

  • Immortal memory— Contains objects that will never be garbage collected or defragmented (or freed.) The RTSJ platform uses immortal memory for various objects, and immortal memory is also shared among all threads. The only disadvantage of immortal memory is that objects in it are immortal. It should be used only for objects that actually are immortal—that will remain in use until the JVM terminates.

  • Scoped memory— Has a defined lifetime. Objects allocated from a memory scope will stay allocated until the scope is no longer active. At that time, all the objects in the scope can be freed.

    And the RTSJ continues support for the normal types of Java ...

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.