Technical sessions | track two | java se, Java se – Google 2007 JavaOne Advance Conference Guide User Manual
Page 24

22
|
| technical sessions | track two : java SE
* Content subject to change.
TECHNICAL SESSIoNS
| TRACK TWO | JAVA SE
Java SE
generic arrays? It shows that you don’t need arrays much anymore but
also how to use them safely—when you really must have them—with
generics. It explains the Principle of Truth in Advertising and the Principle
of Indecent Exposure, which lay down the restrictions necessary for arrays
of generic type to be safely used.
The new collections classes introduced in Java 5 and Java 6 technology
widen the implementation choices to the point where it can be difficult
for a developer to know how to choose the best and most efficient one for
a particular task. The session presents examples of the different scenarios
for the use of the most important implementations, with guidelines for
selecting between them, based on the algorithmic efficiency of their
operations. It explains when and how to use the three new interfaces
introduced in the Java 6 technology.
Increasingly, mainstream developers using the Java programming
language are going to need to understand concurrency, driven by the
changing economics of hardware design, which now favor parallel
operation of multiple cores and multiple processors over increasing
clock speeds. For many programs, increasing efficiency will now mean
parallelization, and programmers using the Java programming language
are well equipped to take advantage of this, if they understand the
concurrent collections introduced in Java 5 technology and extended
in Java 6 technology. The presentation shows the ideas behind the
concurrent collections and the way in which their mechanisms for thread
safety affect their behavior under concurrent modification.
TS-2901 A real-Time Garbage Collector for a real-Time Java
virtual Machine
Bertrand Delsart, Sun Microsystems, Inc.
Antonios Printezis, Sun Microsystems, Inc.
One of the most important features of Java Real-Time System 2.0, to be
released in 2007, is the inclusion of a real-time garbage collector (RTGC).
This presentation introduces this RTGC and demonstrates its advantages.
The presentation first gives a brief overview of the Real-Time Specification
for Java (or RTSJ), covering the three different types of threads (java/lang/
Threads, RealtimeThreads, and NoHeapRealtimeThreads) that can coexist
in an application and the three types of memory (heap, scoped, and
immortal) that can be used.
The session then describes how the RTGC fits in the above model and
discusses some of its characteristics:
• Fully concurrent operation (no stop-the-world phases)
• Latencies in the hundreds-of-microseconds range
• Robustness in terms of shielding critical threads from the rest
• Autotuning to enhance ease of use (only a couple of parameters to set)
The session covers the Java Management Extensions (JMX) technology-
based observability features for RTGC that are being worked on, as well as
an API to dynamically and programmatically change RTGC’s behavior.
It also describes the process of migrating a Java technology application
onto Java Real-Time System 2.0 and how the RTGC can be tuned to enable
the designated real-time threads to achieve extremely low latencies,
illustrating this with a concrete example.
Finally, it also includes specific early customer experiences with
development and deployment of real-time Java technology applications
using Java Real-Time System 2.0, to highlight the strengths and
advantages of Java Real-Time System 2.0.
TS-2906 Garbage-Collection-Friendly Programming
John Coomes, Sun Microsystems, Inc.
Peter Kessler, Sun Microsystems, Inc.
Antonios Printezis, Sun Microsystems, Inc.
Developers often ask this session’s speakers for advice on how to write
code that is more garbage-collection-friendly. Most of the time, their
advice is: don’t believe the urban myths, and don’t do anything special,
because trying to be smart is likely to confuse, instead of help, garbage
collectors. Having said that, over the years, they have developed a small
set of rules of thumb they give customers to help them with garbage-
collection-related issues. This presentation summarizes them.
It starts with a very brief overview of garbage-collection terminology,
to refresh the audience’s memory. The overview covers only concepts
that are touched on during the session, including the characteristics of
generational and incremental garbage collectors.
The remainder of the presentation is split into three sections:
Section 1:
General advice—This section covers some general programming
advice on how not to get in the way of the garbage collector, such as the
following:
• Object allocation is very cheap, so don’t be afraid of it.
• The use of object pools should be avoided, except in special
circumstances.
• Reference nulling is largely unnecessary, except on a few very specific
occasions.
The next two sections cover garbage-collection-related features of the Java
programming language.
Section 2:
Finalizers—Blind use of finalization can put unnecessary load
on the garbage collector. This section covers traps a programmer can
easily fall into when using finalization and how to avoid such traps.
Section 3.
References—This section gives an overview of the three
reference types of the Java programming language, advises which type to
use when, and illustrates different usage patterns.
Wherever possible, concrete demos illustrate pathologies in programs
that stress the GC and show how they can be rectified.
TS-2992 Tricks and Tips with NIo, using the Grizzly Framework
Jean-François Arcand, Sun Microsystems, Inc.
Alan Bateman, Sun Microsystems, Inc.
Scott Oaks, Sun Microsystems, Inc.
Writing scalable high-volume traffic network server applications in
the Java programming language has always been difficult. Before the
advent of the Java New I/O (NIO) API, thread and buffer management
issues made it impossible for a server to scale to thousands of users. But
using NIO presents its own challenges in terms of program design and
implementation. However, the Grizzly project has gained a lot of interest
and adoption over the past two years, as a result of its performance and
scalability as a general-purpose Java NIO Framework.
This session discusses some tricks and tips the speakers have learned in
working on the Grizzly NIO Framework. They describe how to efficiently
manage the byte buffer and how to properly handle SelectionKey,
recommend some thread and byte buffer techniques, and talk about
efficient NIO/SSL implementation. Finally they compare the Grizzly
framework with other existing Java NIO API frameworks.
>>
Te
ch
n
ic
al
S
es
si
o
n
s
:
Tr
ac
k
2
|
Ja
va
S
E
n
n
n
n
n
n
n
n
n