JSR-282 SI 13.0 ------------------------------------------------ Summary --------------------- Permit all errors associated with exceeding RTSJ resource limits to fire async events (or alternatively, release async event handlers). Currently some of them can only throw exceptions. Specification References --------------------- This will add methods to the MemoryParameters, and MemoryArea classes. Problem being Addressed --------------------- In RTSJ 1.0.2, missing a deadline or overrunning a budget can release a handler, but we don't clearly say what the implementation should do in case an SO exceeds a memory budget. Proposed Solution Summary The limits are: Heap allocation rate Immortal allocation budget Initial memory area allocation budget We need to: 1.) Be clear about what an application should do (the RI throws an out of memory error.) 2.) Offer some flexibility by letting the application provide a handler that should be released. The policies are: * Ignore * Throw an error * Release a handler * Release a handler and throw an error We can do this with three new handlers optionally attached to the memory parameters object. MemoryParameters( long maxMemoryArea, AsyncEventHandler memoryAreaBudgetHandler, long maxImmortal, AsyncEventHandler immortalBudgetHandler, long allocationRate, AsyncEventHandler rateBudgetHandler) set/getMemoryAreaBudgetHandler set/getImmortalBudgetHandler set/getRateBudgetHandler Semantics --------------------- In each case, if the handler is not specified the implementation shall throw an OutOfMemoryError. If the handler is specified, the SO shall be descheduled immediately and the AEH released. The AEH may re-schedule the SO. Discussion Points --------------------- Should the handler have a way to cause the SO to receive an out of memory error? Is there some way to do this without blowing up the constructor? On the other hand, should we provide some constructors that have some of the handlers? Compatibility Issues --------------------- No "non-standard" issues.