8. Related Work
Altering Java semantics via bytecode transformations has been used for many purposes that can be generally characterized as adding reflection or aspect-orientedness to off-the-shelf software components [9, 23, 30]. Our approach also fits this description, since we reify the CPU con- sumption, which is an original idea. J-RAF2 relies on the Byte Code Engineering Library BCEL  for the low-level operations.
In the following we present related work on the two main subjects of this article, namely resource management in Java, and static path prediction schemes.
8.1. Resource Management in Java
Prevailing approaches to provide resource control in Java-based plat- forms rely on a modified JVM, on native code libraries, or on program transformations. For instance, the Aroma VM , KaffeOS , and the MVM  are specialized JVMs supporting resource control. In contrast, our approach does not require any JVM modifications and is compatible with any standard JVM.
JRes  is a resource control library for Java, which uses native code for CPU control and rewrites the bytecode of Java programs for memory control. For CPU control, some light bytecode rewriting is also applied to enable proper cooperation with the OS via native code libraries. JRes does not support bytecode-level accounting, as this seemed prohibitive in terms of performance. Another difference is that in JRes information is obtained by polling the OS about the CPU consumption of threads, and therefore requires a JVM with OS- level threads, which is not always available. Researchers at Sun are also working on incorporating resource management as an integral part of the Java language ; this proposal requires substantial additional support that has to be first introduced into the platform.
8.2. Static Path Prediction
Our path prediction scheme may be seen as just another name for branch prediction . However our purpose is slightly different from existing approaches, which focus on lower-level objectives such as de- signing compilers that generate optimal code for a given family of processors , or predicting the worst-case execution time in view of implementing a hard real-time system . Some approaches use per- application tailored feed-back received from off-line simulations: that kind of prediction is in fact semi-static, as opposed to purely static approaches like ours, which rely only on the information that can be