[sisyphus] J2ME (was: Oracle9i)
Alexander Bokovoy
=?iso-8859-1?q?a=2Ebokovoy_=CE=C1_sam-solutions=2Enet?=
Ср Мар 6 19:13:55 MSK 2002
On Wed, Mar 06, 2002 at 07:06:33PM +0300, Vitaly Lugovsky wrote:
> On Wed, 6 Mar 2002, Alexander Bokovoy wrote:
>
> > В J2ME (Micro Edition), вышедшей в феврале этого года, доступны на выбор
> > (compile time) три разных алгоритма GC: generational (default), semispace
> > и mark&sweep. Это, конечно, не сборка мусора на этапе компиляции, но
> > значительно лучше до сих пор использующегося в J2SE/J2EE. Подробности в
> > исходниках J2ME: cdcfoundation/doc/guide/gc.html
> >
> > На объемах памяти до 2Мб эта штука ведет себя очень приятно.
> А можно этот рантайм прикрутить к J2SE? Или нереально?
> Нужно только, чтоб оно умело гонять Resin+GNU Kawa+GNU BRL servlet...
Понимаю. Но видимо, пока что нереально. Никто не видел исходников J2SE?
Исходники J2ME доступны и в качестве виртуальной машины там используется
новая CVM. Вот только J2ME RMI Profile, который почти соответствует J2SE за
исключением Swing и некоторых других компонент, не доступен для скачивания
в страны СНГ.
С Вашего разрешения процитирую overview.html из J2ME, чтобы было понятно,
что в ней есть; я смотрел конфигурацию CDC.
----------------------------------------------------------------------------
Introduction
JavaTM 2 Platform, Micro Edition is the inner plumbing of Java technology
on the Go!
The JavaTM 2 Platform, Micro Edition (J2ME) technology is designed and
architected to address the needs of a broad range of consumer electronic
and embedded devices. J2ME supports environments targeted at consumer
products. It provudes a framework for effectively organizing categories of
devices and specifying environments for the categories.
Architecture Overview
The J2ME architecture is based on two fundamental elements:
* Configuration: a virtual machine and a minimal set of core class
libraries and APIs. A configuration specifies a generalized runtime
environment for consumer electronic and embedded devices.
* Profile: an industry-defined specification of the Java APIs used by
manufacturers and developers to address a type of consumer electronic
or embedded device.
Together, a configuration and a profile deliver a specification for
consumer electronics and embedded device manufactures to implement on
their products. They provide a Java Application Environment to which third
party developers can write their applications.
J2ME Configurations
Currently, J2ME offers two complementary configurations:
* Connected, Limited Device Configuration (CLDC)
* Connected Device Configuration (CDC)
Both are derived through the Java Community Process and targeted at
different ends of the consumer electronics and embedded devices industry.
CLDC Devices
The Connected, Limited Device Configuration (CLDC) is intended for
lower-end devices. Typically, these devices are battery powered, run a 16-
or 32-bit RISC/CISC microprocessor/controller, with as little as 160Kb -
512Kb of total memory; 128Kb for the storage of the K virtual machine and
libraries.
CLDC contains the K virtual machine (KVM). The KVM is a new virtual
machine designed from the ground up and optimized with the constraints of
inexpensive, lower-end devices. Named to reflect that its size is measured
in terms of kilobytes, the KVM is suitable for these resource-constrained
devices.
CDC Devices
The Connected Device Configuration (CLDC) is intended for higher-end,
emerging, next generation devices. Typically, these devices run a 32-bit
microprocessor/controller and contain more than 2.0Mb of total memory for
the storage of the C virtual machine and libraries.
CDC contains the C virtual machine (CVM). The CVM is a full-featured, Java
2 "Blue Book" virtual machine; designed for devices needing the
functionality of the Java 2 VM feature set. The CVM APIs are a superset of
the KVM
J2ME Profiles
Currently, the following industry-defined profiles are available.
Mobile Information Device Profile
The Mobile Information Device Profile (MIDp) is a set of Java APIs that
provide a complete J2ME application runtime environment targeted at mobile
information devices, such as cellular phones and two-way pagers. This
allows new applications and services to be dynamically deployed on the end
user devices. The MIDp specification addresses issues such as user
interface (UI), persistence storage, networking, and appliation model.
Foundation Profile
The Foundation Profile (FNDp) is a set of Java APIs intended for
higher-end devices requiring a custom user interface (UI), which is
typically provided by a device manufacturer. FNDp is designed to run with
the Connected Device Configuration (CDC).
Personal Profile
The J2ME Personal Profile provides the J2ME environment for those devices
with a need for a high degree of Internet connectivity and Web fidelity.
A Java Community Process (JCP) expert group has been convened to create an
industry-defined user interface (UI) profile. Tentatively, this is being
called the Personal Profile. This profile works in combination with CDC
and FNDp.
RMI Profile
The J2ME RMI Profile provides Java platform to Java platform remote method
invocation for Java devices and interoperates with J2SE RMI.
CVM Feature Set
The C Virtual Machine (CVM) is the basis for J2ME CDC and profiles. Many
JVMs for desktops and servers do not scale well to embedded and consumer
environments.
CVM is a new VM implementation for consumer and embedded systems.
* Complete Java 2 VM (Blue Book)
* Small and reliable
* More deterministic behavior
* Modular and tunable
* ~256KB with JNI, reflection, verification, and class loading
Optimized Interpreter
The CVM interpreter optimizes:
* Method calls and returns
* Java synchronization support
Fast Java Synchronization
The CVM uses light-weight locking if there is no contention. It uses just
a couple of bits.
Native Thread Support
The CVM supports native threads and arbitrary thread pre-emption at
machine instruction boundaries. It has proper internal synchronization,
and handles exact garbage collection and Java synchronization correctly in
the presence of pre-emptive native threading.
Memory System
The CVM memory system features the following:
* Exactness
* Small average garbage collection pause times
* Full separation of VM from the memory system
* Pluggable garbage collectors
* Generatinal garbage collection
ROMable Classes
The CVM runs with "pre-loaded", mostly read-only classes. This provides
better start-up time, less fragmentation, more data sharing, and the
ability to execute byte-codes out of ROM.
Small Class Footprint
The small class footprint reduces loaded and ROMized class footprints to a
minimum, about 40% compared to JDK classic and 17% compared to Personal
Java.
1.3 VM Support
CVM supports the 1.3 VM features and libraries, including weak references,
reflection, serialization, JNI, and RMI.
Java 2 Security
CVM supports Java 2 security.
JPDA Support
The JPDA support consists of:
* JVMDI support
* Remote debugging support
* Connect via Java Debug Wire Protocol (JDWP)
Portable
The CVM is implemented in C, with very little assembler.
Porting Layer
The CVM contains a rich, well-documented porting layer. It is RTOS-aware,
supports multiple porting options (for the tricky stuff), and provides the
bare minimum left to the porter for fast re-targeting.
Hardened System
The "hardened" system in low memory cases ensures that failures such as
out of memory and out of file descriptors are handled gracefully.
Stack Usage
The CVM utilizes deterministic and limited stack usage.
* Static analysis on the executable reduces C recursion to a minimum.
* Stack checks for the few remaining recursion cases prevent stack
overflow.
* Reduced native stack usage wherever possible.
Startup and Shutdown
The CVM provides ordered shutdown and re-startability.
* Clean shutdown and re-start of our VM in the same address space (e.g.,
on a RTOS), without help from a process model.
* Free up all our memory and stop all our threads without any leaks on
VM shutdown.
* Re-initialize correctly on VM re-start.
Interfaces
The CVM provides extensible and well-defined interfaces.
* The interfaces between components, like garbage collection, type
system, locking and interpreter are clearly defined, well-separated,
and well-documented.
* It is much easier to add new features to CVM compared to the previous
Personal Java Virtual Machine.
----------------------------------------------------------------------
Copyright © 2000 Sun Microsystems, Inc. All Rights Reserved. Sun
------------------------------------------------------------------------------
--
/ Alexander Bokovoy
Software architect and analyst // SaM-Solutions Ltd.
---
QOTD:
"I've always wanted to work in the Federal Mint. And then go on
strike. To make less money."
Подробная информация о списке рассылки Sisyphus