Re: CLDC1.1+Jsr184+HW acc+reliable=impossible?
Joe Bowbeer <[email protected]>
| Newsgroups | gmane.comp.java.sun.kvm |
|---|---|
| Message-ID | <[email protected]> |
On 8/3/07, Robin Chaddock <[email protected]> wrote: > I'm curious how the jsr184 api is designed to support underlying hardware > acceleration when built upon the cldc1.1 platform. > > a) CLDC implementations are not required to provide finalizer support; so > the platform cannot guarantee garbage collection of Java objects will > trigger the release of their native resources) > b) Very few of the Java classes (infact only Graphics3D?) have provision for > explicit dispose()/destroy()/release() methods. > > These 2 limitations when coupled together make me think that providing a > reliable implementation of the jsr184 api when built upon a platform that > supports only the minimal feature set for CLDC1.1 compatibility is > fundamentally impossible. > > Obviously if the CLDC implementation went beyond it's needed minimum specs, > such as offering an under-the-hood means of performing object finalization, > or made the garbage collector aware of native graphics resources - then > implementing a hardware accelerated jsr184 api would not be so difficult. > > This observation appears to approximate reality, as a vast number of > handsets that 'support' jsr184 do so in very hap-hazard way - typically > leaking native resources from every proverbial orifice. (Nokias tend to be > the primarily culprits, but SE and other manufacturers have their fair share > of broken implementations too) > Java's finalize method has been much maligned in Java SE so I find it curious that you're advocating it for Java ME. I view finalize as a last ditch cleanup hook that should be avoided in practice (by explicit cleanup). Which additional resources could benefit from explicit cleanup methods? MIDlets have a few finalize-like notifications already, such as Canvas.hideNotify(), MIDlet.pauseApp() and MIDlet.destroyApp(). Is it possible for the cleanup methods to hook into one of these? If so, freeing the HW-acc resources on hideNotify and reacquiring them on showNotify is the most conservative approach. -- Joe Bowbeer =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff KVM-INTEREST". For general help, send email to [email protected] and include in the body of the message "help".