Frugal Mobile Objects

Benoît Garbinato, Rachid Guerraoui, Jarle Hulaas, Maxime Monod, Jesper Honig SpringInfoscience 2005

Abstract

This paper presents a computing model for resource-limited mobile devices. The originality of the model lies in the integration of a strongly-typed event-based communication paradigm with abstractions for frugal control, assuming a small footprint runtime. With our model, an application consists of a set of distributed reactive objects, called FROBs, that communicate through typed events and dynamically adapt their behavior reacting to notifications typically based on resource availability. FROBs have a logical time-slicing execution pattern that helps monitor resource consuming tasks and determine resource profiles in terms of CPU, memory, and bandwidth. The behavior of a FROB is represented by a set of stateless first-class objects. Both state and behavioral objects are referenced through a level of indirection within the FROB. This facilitates the dynamic changes of the set of event types a FROB can accept, say based on the available resources, without requiring a significant footprint of the underlying FROB runtime. We demonstrate the usability of the FROB model through our Java-based prototype and a peer-to-peer audio streaming scenario where an audio provider dynamically adjusts its quality of service by adapting to demand. The performance results of our prototype convey the small footprint of our FROB runtime (86 kilobytes). We also augmented the KVM to enable resource profiling with however a negligible overhead (less than 0.5%) and a decrease in speed of the virtual machine of at most 7%.

Introduction

Traditional distributed computing models, such as Remote Procedure Calls (RPC), were designed for stable, wired environments with abundant resources. In the mobile domain, however, "exception is the norm": connectivity is intermittent, battery life is finite, and memory is often scarce. Existing industry standards like Java ME or the .NET Compact Framework are largely scaled-down versions of desktop models that lack native abstractions for frugality—the ability of software to be resource-aware and adaptive. This paper introduces FROBs (Frugal Mobile Objects), a model where software gracefully degrades its functionality in response to resource pressure rather than failing outright.

The FROB Architecture

The core of the model is the FROB, a reactive object designed for a small-footprint runtime. A FROB is composed of an external interface, an event queue, a state representation, and a central dictionary.

The internal architecture of a FROB, highlighting the dictionary (5) that maps event types to behavioral objects.

The dictionary acts as a level of indirection, mapping incoming event types to specific "behavioral objects." Unlike standard object-oriented models where behavior is hard-coded, a FROB’s behavior consists of stateless, first-class citizens. This indirection allows the runtime to dynamically swap behaviors—for example, replacing a "High-Quality Audio" processing object with a "Low-Quality" version—simply by updating a dictionary entry. This "hot-swapping" capability enables applications to "shrink" or "grow" their functionality based on real-time CPU, memory, and bandwidth availability.

Communication and Execution Model

FROBs interact through a typed, event-based publish-subscribe model rather than direct method calls. This loose coupling is essential for mobile environments where devices may frequently disconnect.

The FROB communication model: devices publish events to a routing cloud, which are then delivered to the interfaces of subscribing FROBs.

To maintain a small footprint, FROBs utilize fine-grained serialization. Each behavioral object includes its own minimal (de)serializer, ensuring that only the code necessary for currently handled events is loaded into memory. Furthermore, FROBs are threadless; the runtime assigns a thread to execute one behavioral object at a time in a logical time-slicing pattern. This prevents thread monopolization and simplifies state checkpointing or migration.

Resource Profiling and Evaluation

To enable frugality, the authors modified the KVM (Java’s mobile virtual machine) to track bytecode execution and memory allocation. This allows the system to generate "resource profiles" for code segments.

The model was evaluated using a peer-to-peer audio streaming scenario on an ad-hoc network. A mobile provider adjusted its Quality of Service (QoS) by switching streaming behaviors based on the number of connected clients and available memory.

Key Results

  • Small Footprint: The FROB runtime requires only 86 KB, significantly less than standard Java reflection and serialization packages.
  • Efficiency: Indirection via the dictionary added only 0.5% overhead to total execution time in real-world tests.
  • Profiling Overhead: KVM modifications increased VM size by less than 0.5% and reduced execution speed by at most 7%.
  • Memory Trade-off: While the dictionary-based representation is roughly 8x heavier on the heap than standard objects, this is offset by the system's ability to aggressively unload unused behavioral code.

Conclusion

The FROB model demonstrates that resource-awareness can be integrated into mobile software without prohibitive overhead. By treating resources as finite luxuries and decoupling behavior from state through indirection, FROBs provide a robust framework for adaptive mobile applications. Future work will address optimizing heap usage, handling complex control flows, and exploring security implications for dynamic behavior loading.

Summary updated

Abstract

This paper presents a computing model for resource-limited mobile devices. The originality of the model lies in the integration of a strongly-typed event-based communication paradigm with abstractions for frugal control, assuming a small footprint runtime. With our model, an application consists of a set of distributed reactive objects, called FROBs, that communicate through typed events and dynamically adapt their behavior reacting to notifications typically based on resource availability. FROBs have a logical time-slicing execution pattern that helps monitor resource consuming tasks and determine resource profiles in terms of CPU, memory, and bandwidth. The behavior of a FROB is represented by a set of stateless first-class objects. Both state and behavioral objects are referenced through a level of indirection within the FROB. This facilitates the dynamic changes of the set of event types a FROB can accept, say based on the available resources, without requiring a significant footprint of the underlying FROB runtime. We demonstrate the usability of the FROB model through our Java-based prototype and a peer-to-peer audio streaming scenario where an audio provider dynamically adjusts its quality of service by adapting to demand. The performance results of our prototype convey the small footprint of our FROB runtime (86 kilobytes). We also augmented the KVM to enable resource profiling with however a negligible overhead (less than 0.5%) and a decrease in speed of the virtual machine of at most 7%.
BibTeX
@inproceedings{garbinato2005frugal,
  author = {Benoît Garbinato and Rachid Guerraoui and Jarle Hulaas and Maxime Monod and Jesper Honig Spring},
  title = {{Frugal Mobile Objects}},
  booktitle = {Infoscience},
  year = {2005},
}
Figure