Strict RTSJ Semantics

Through builder option -strictRTSJ, the relaxations just described are deactivated and strict RTSJ semantics are enforced. Applications that should be portable to different RTSJ implementations should consequently be developed with this options switched on when an application is built.

Use of Memory Areas

All NoHeapRealtimeThreads of application built in -strictRTSJ mode must run in scoped or immortal memory. The thread object itself, the thread logic, scheduling, release, memory and group parameters must also not be allocated in heap memory. Otherwise, a MemoryAccessError is thrown on the creation of such a thread.

RealtimeThreads are free to use heap memory even in -strictRTSJ mode, and they still profit from the lack for garbage collection pauses in JamaicaVM. Application code that shall be portable to other Java implementations that are not based on realtime garbage collection should not use heap memory for time critical threads.

Normal threads are not allowed to enter non-heap memory areas in -strictRTSJ mode.

Thread priorities

Thread priority for normal Java threads must be in the range java.lang.Thread.MIN_PRIORITY through java.lang.Thread.MAX_PRIORITY while RealtimeThreads and NoHeapRealtimeThreads share the priority range javax.realtime.PriorityScheduler.instance().getMinPriority() through javax.realtime.PriorityScheduler.instance().getMaxPriority().

Runtime checks for NoHeapRealtimeThread

If -strictRTSJ is set, runtime checks on all memory read operations (i.e., accesses to static and instance fields and accesses to reference array elements) are checked to ensure that no object on the garbage collected heap is touched by a NoHeapRealtimeThread.

These runtime checks are required by classical Java implementation with a non-realtime garbage collector. They may pose an important runtime overhead on the application.

Static Initializers

When -strictRTSJ is set, static initializers are executed within immortal memory. This means that all objects allocated by static initializers are accessible by all threads. Care is required since any allocations performed within static initializers of classes that are loaded dynamically into a system will never be recycled. Dynamic class loading consequently provides a severe risk of introducing a memory leak into the system.

Class PhysicalMemoryManager

When -strictRTSJ is set, names and instances of class javax.realtime.PhysicalMemoryTypeFilter that are passed to method registerFilter of class javax.realtime.PhysicalMemoryManager must be allocated in immortal memory as required by the RTSJ.