beautypg.com

Technical sessions | track five | java me – Google 2007 JavaOne Advance Conference Guide User Manual

Page 38

background image

36

|

| technical sessions | track five : java ME

| java.sun.com/javaone

* Content subject to change.

TECHNICAL SESSIoNS

| TRACK FIVE | JAVA ME

Java ME

TS-5585 Whiz-Bang Graphics and Media Performance for Java ME

Applications

Ashmi Bhanushali, NVidia Corporation
Pavel Petroshenko, Sun Microsystems, Inc.
Nandini Ramani, Sun Microsystems, Inc.

Java ME has several graphics APIs, including JSR 184, JSR 239 (for 3-D
graphics), JSR 226 (for 2-D graphics), and JSR 135 and JSR 234 (for media).
This session starts with an overview of these graphics APIs and discusses
the appropriate API for different use cases. It then covers platform
implementation techniques being used to provide excellent performance
for applications using these APIs. These techniques include utilization
of hardware acceleration and VM optimizations for media and graphics
applications.

Hardware acceleration for graphics and media is available on mobile
devices today and is expected to grow significantly over the next few
years. The presentation focuses on leveraging the underlying hardware
to create compelling, high-performance applications on the Java ME
platform. It shows code examples of 2-D/3-D graphics and media
applications, highlighting the areas that use the graphics processing unit
(GPU) and the central processing unit (CPU). Knowledge of hardware
characteristics enables application developers to achieve optimal
performance. The session shows code examples of how this can be
achieved by adaptation of the code to the level of acceleration available.

VM optimizations for a better 2-D and 3-D interactive experience for
gaming, for example, include general Java technology-based performance
enhancements, minimization and even distribution of pauses, predictable
garbage collection, use of the memory-mapping unit and vector floating-
point coprocessor, and runtime compiler support for graphics and media
applications.

The session includes several code samples and demos on devices for each
of the 2-D/3-D APIs as well as media APIs.

TS-5617 open Source object-oriented databases for Java ME

Technology-Based Embedded Systems

Andrei Gorine, McObject
Konstantin Knizhnik, McObject

Java ME provides a runtime environment for software on multiple devices,
such as mobile phones, PDAs, and TV set-top boxes. These applications
increasingly require sophisticated data management to support software
such as electronic programming guides in set-top boxes, address book
applications in mobile phones, and music indexes in digital audio players.

Embedded applications often store and process data locally (the database
and application reside on the same device). In such cases, relational
databases become impractical, in large part due to the sophisticated,
resource-consuming SqL optimizers needed to execute queries. In fact,
the level of query processing provided by an Oracle, or even a MySqL,
database is often not required, because the queries are simple and
are known when the application is compiled. This enables specialized
resource-conserving data management solutions to be developed for
embedded devices.

Object-oriented databases offer the advantage of seamless integration
with object-oriented programming languages. With a relational
database, the application must translate the relational representation
of the application’s data to the object representation required by the
host language. Some modern IDEs and modeling tools generate this
“translation” code automatically. However, this extra layer of code still
constrains performance, compared to object-oriented databases’ direct
data access.

Despite the promise of object-oriented database systems, few have
emerged for the Java ME platform, because object-oriented databases
depend on Java technology-based features that are limited or nonexistent
in Java ME. This presentation illustrates how efficient object-oriented
data management for the Embedded Java application environment can be
achieved by “engineering around” the absence of such Java technology-
based features as a reflection mechanism or “weak reference” support.
These techniques—honed by the presenters while developing the Perst
Lite open source, object-oriented Java ME database—provide both an
excellent window on Java ME internals and a roadmap for attendees also
navigating Java ME’s strictures.

Usually an object-oriented database’s interface with the host application
is based on reflection capabilities in the host language, for inspecting
the object format at runtime. However, due to its complexity, reflection
is omitted in Java 2 Platform, Micro Edition (J2ME), so a database must
be designed to live without reflection. One solution, from the C/C++
world, is for the application to provide pack and unpack routines to
serialize and deserialize objects, and the database runtime to use these
to fetch and store objects. The presentation introduces such routines in
Java technology, including the option of providing a utility to automate
generation of such code.

Caching is another challenge. An OODBMS’s object cache keeps
frequently used objects in memory, to avoid excessive disk I/O. Java
technology’s memory deallocation or “garbage collection” is problematic
alongside the object cache. If the object is “pinned” into the cache
with a “strong reference,” the garbage collector won’t deallocate it.
As a result, the object cache grows and can take all available memory
or even overflow memory. To counter this, Java technology provides
“weak references” that allow a program to reference an object while
also allowing that object to be reclaimed. But because weak references
greatly complicate garbage collection, they are omitted from many device-
specific Java ME variants.

Therefore, in Java ME, a database must control the size of the object cache
explicitly—for example, by clearing the cache upon transaction commit.
With such strategies, object orientation and such inherent database
strengths as transaction support, optimized algorithms, and significantly
shorter time to market can benefit developers on the Java ME platform.

Te

ch

n

ic

al

S

es

si

o

n

s

:

Tr

ac

k

5

|

Ja

va

M

E

n

n

n

n

n

n

n

n

n