Contents Previous Next Index

Chapter   2

Lifetime of the Java Card Virtual Machine


In a PC or workstation, the Java virtual machine runs as an operating system process. When the OS process is terminated, the Java-language applications and their objects are automatically destroyed.

In Java Card technology the execution lifetime of the virtual machine (VM) is the lifetime of the card. Most of the information stored on a card shall be preserved even when power is removed from the card. Persistent memory technology (such as EEPROM) enables a smart card to store information when power is removed. Since the VM and the objects created on the card are used to represent application information that is persistent, the Java Card VM appears to run forever. When power is removed, the VM only stops temporarily. When the card is next reset, the VM starts up again and recovers its previous object heap from persistent storage.

Aside from its persistent nature, the Java Card virtual machine is just like the Java virtual machine.

The card initialization time is the time after masking, and prior to the time of card personalization and issuance. At the time of card initialization, the Java Card RE is initialized. The framework objects created by the Java Card RE exist for the lifetime of the virtual machine. Because the execution lifetime of the virtual machine and the Java Card RE framework span CAD sessions of the card, the lifetimes of objects created by applets will also span CAD sessions. (CAD means Card Acceptance Device, or card reader. Card sessions are those periods when the card is inserted in the CAD, powered up, and exchanging streams of APDUs with the CAD. The card session ends when the card is removed from the CAD.) Objects that have this property are called persistent objects.

The Java Card RE implementer shall make an object persistent when:

 


Contents Previous Next Index Runtime Environment Specification for the Java Card Platform
Specification, 2.2.1