在不朽内存中创建审计线程对象,在堆中运行。
Create the auditing thread object in immortal, running in the heap.
我们的选择是限于作用域和不朽内存的某种组合。
Our choice is restricted to some combination of scoped and immortal memory.
由于忽略了堆和作用域,我们剩下的只有不朽内存。
Having discounted the heap and scopes, we are left with immortal memory.
这些内存区域称为作用域内存和不朽内存。
These memory areas are referred to as scoped and immortal memory.
分配在不朽内存中的对象可以被所有的线程访问并且从来不会被收集。
Objects allocated in the immortal memory area are accessible to all threads and are never collected.
正由于它永远不会被收集,不朽内存是一个有限制的资源,必须谨慎使用。
Because it is never collected, immortal memory is a limited resource that must be used carefully.
要为我们的设计应用作用域和不朽内存,首选需要对其工作原理略知一二。
Before we can apply scoped and immortal memory to our design, we need to understand a little more about how they work.
您可以使用标准的RTSJ 作用域和不朽内存区域实现前面提出的模型。
You can implement the proposed model using standard RTSJ scopes and the immortal memory area. Scopes are used to support objects with the defined lifetimes, as indicated in Table 3
在不朽内存中创建的对象从来不会被清除,在应用程序的生命周期中一直存在。
Objects created in immortal memory are never cleaned up and live for the application's lifetime.
为确保堆和不朽内存区域的完整性,RTSJ定义了使用作用域内存的规则。
To ensure the integrity of the heap and the immortal memory area, the RTSJ defines rules for using scoped memory.
我们知道,不朽内存永远不会还原,因此无法如愿地继续创建Measurement对象,因为那样将耗尽内存。
We know that immortal memory is never recovered, so we cannot keep creating Measurement objects at will because we would run out of memory.
例如,每个生产线轮询线程都将在不朽内存中启动,查询ProductionLine之前,要为其预先创建一个作用域。
For our example, each production line polling thread will be started in immortal memory and have a scope created up front that's entered each time before querying the ProductionLine.
为了确保对象之间引用的完整性,RTSJ定义了管理一个内存区域(堆、不朽内存、作用域内存)中的对象如何引用其他内存区域对象的规则。
To ensure the integrity of references between objects, the RTSJ defines rules that govern how objects in one memory area (heap, immortal, or scope) can refer to objects in other memory areas.
由于这些复杂性,建议只对那些不能够忍受GC暂停的组件使用不朽和作用域内存。
Because of these complexities, the recommended use of immortal and scoped memory is limited to components that cannot tolerate GC pauses.
由于这些复杂性,建议只对那些不能够忍受GC暂停的组件使用不朽和作用域内存。
Because of these complexities, the recommended use of immortal and scoped memory is limited to components that cannot tolerate GC pauses.
应用推荐