COARA: Code Offloading on Android with Aspectj

COARA: Code Offloading on Android with Aspectj

1 COARA: Code Offloading on Android with AspectJ Roy Friedman∗ and Nir Hauser∗ ∗ Technion – Israel Institute of Technology Department of Computer Science Haifa, Israel F Abstract—Smartphones suffer from limited computational capabilities tation intensive code to be offloaded, we can leverage the and battery life. A method to mitigate these problems is code offloading: disparity between mobile and server computing power executing application code on a remote server. We introduce COARA, to achieve better performance and longer battery life on a middleware platform for code offloading on Android that uses aspect- the mobile device. oriented programming (AOP) with AspectJ. AOP allows COARA to inter- cept code for offloading without a customized compiler or modification of In this paper, we introduce COARA, a middleware the operating system. COARA requires minimal changes to application platform for code offloading on Android that uses source code, and does not require the application developer to be aware aspect-oriented programming (AOP) [30] with AspectJ of AOP. Since state transfer to the server is often a bottleneck that [4]. AOP allows COARA to intercept code for offloading hinders performance, COARA uses AOP to intercept the transmission of without a customized compiler or modification of the large objects from the client and replaces them with object proxies. The operating system. COARA requires minimal changes to server can begin execution of the offloaded application code, regardless of whether all required objects been transferred to the server. We run application source code. The application developer does COARA with Android applications from the Google Play store on a not need to be aware of AspectJ to use COARA. Nexus 4 running unmodified Android 4.3 to prove that our platform Execution of a method on a remote sever requires that improves performance and reduces energy consumption. Our approach the application state must be transferred along with the yields speedups of 24x and 6x over WiFi and 3G respectively. method. State transfer to the server is often a bottleneck that hinders performance, especially on low-bandwidth 3G connections. To minimize state transfer, COARA uses 1 INTRODUCTION AOP to intercept the transmission of large objects from Mobile computing is quickly becoming the prominent the client to the server, replacing the objects with object computing and communication platform. Smartphones proxies. Object proxies act as server-side placeholders for and tablets have become ubiquitous, while mobile ap- objects whose state, by design, has not been transferred plications are increasing in complexity. However, even to the server. The server can begin execution of the with recent improvements in mobile processing power, offloaded application code, regardless of whether all server processors are substantially more powerful [21]. required objects have been transferred to the server. arXiv:1604.00641v1 [cs.DC] 3 Apr 2016 The primary focus of mobile design is long battery COARA enables two data transmission strategies that life, minimum size and weight, and heat dissipation. use object proxies: lazy and pipelined transmission. With Computing power is often compromised in favor of lazy transmission, COARA assumes that large objects these other priorities [26]. New mobile devices such as will not be needed and therefore replaces the objects the Pebble watch and Google Glass may have even less with proxies when transferring state to the server. If code computing power than current smartphones [20]. executing on the server accesses the proxy, COARA will This challenge has been tackled in the past using the halt execution and grab the object from the mobile de- client-server model, where the developer is responsible vice. With pipelined transmission, COARA also replaces for writing code that issues requests to an API on a objects with proxies, however operates under the as- server. The downside of this approach is that rather sumption that most of the objects will be accessed. There- than focusing on application functionality, the developer fore, immediately after offloading the method, COARA must invest resources in writing code to support net- transmits the large objects to the server in a pipelined work communication. If network connectivity is poor or manner. Pipelined transmission allows the server to get unavailable, the application may be unable to execute. a “head start” and execute code while the rest of the heap One approach to addressing these challenges is code is still being transferred. COARA also supports an eager offloading: using middleware to automatically execute ap- transmission strategy that transfers the entire reachable plication code on a remote server. By identifying compu- heap to the server without the use of object proxies. We 2 discuss these strategies in greater detail in Section 4.4 of CloneCloud’s approach to offloading is the overhead and show their effectiveness in improving performance required to migrate the entire VM from the mobile device in our evaluation. to the server. In addition, the server must already be run- We evaluated COARA using a Nexus 4 running un- ning a hardware simulator with the same configuration modified Android 4.3 on applications from the Google as the mobile device, further complicating matters. Play store as well as applications we wrote that wrap ThinkAir [31], like MAUI, provides method level code open source Java libraries. Our approach achieves offloading but focuses more on scalability issues and speedups of 24x and 6x over WiFi and 3G respectively. parallel execution of offloaded tasks. It uses a custom While this paper focuses on performance improvement, compiler to insert offloading logic. ThinkAir creates a COARA was also able to achieve reductions of energy VM on the cloud and can allocate multiple VMs to consumption of 11x over WiFi and 3x over 3G. handle a single application. However, the authors do The rest of this paper is organized as follows. We not discuss how they merge the application states from discuss related work in Section 2 and present some back- multiple VMs back to the original application. ground terminology and technology in Section 3. The The Cuckoo [29] framework takes advantage of the design goals and architecture of COARA are explained existing activity/service model in Android. The model in Section 4. We evaluate the usage and performance of makes a separation between the computation intensive COARA in Section 6. We discuss limitations of the cur- parts of the application and the rest of the application. rent system and future work in Section 7 and conclude Cuckoo offloads the well-defined computation intensive in Section 8. portions of the applications. It requires the developer to write offloadable methods twice — once for local computations and once for remote computations. This 2 RELATED WORK allows flexibility but may lead to unnecessary code FarGo [28] is a system that enables distributed applica- duplication. tions to maintain a separation between application logic COCA [17] uses AspectJ to offload Android appli- and the layout of components on the underlying physical cations to the cloud. COCA finds that the overhead system. FarGo allows components known as complets to incurred by AspectJ is minimal. However, COCA is be relocated based on events at runtime. FarGo extends only capable of offloading pure functions which only Java and uses Java RMI to communicate between JVMs. access the function parameters and are therefore obliv- While FarGo is able to decouple application logic from ious to the rest of the heap. Hence, COCA does not layout logic, the system is tightly coupled with the appli- tackle the hard problem of state transfer which MAUI cation itself. FarGo requires that existing applications be demonstrates is one of the key challenges of offloading. rewritten to adhere to the FarGo programming model. Requiring real world applications to only offload pure Early attempts at offloading like Spectra [22] and functions would severely limit the number of functions Chroma [14] focused on partitioning the application into that could be offloaded. On the hand, COARA supports modules and calculating the optimal offloading strategy. state transfer and provides techniques to minimize the These partitioning schemes require significant modifica- resulting overhead. tion of the original application. Calling the Cloud [24] is a middleware platform that The MAUI [19] architecture provides the capability can automatically distribute different layers of an appli- of fine-grained code offload with minimal application cation between the phone and the server, and optimize changes. It shows that minimizing the size of application a variety of objective functions. However, it requires the state transfer vastly improves performance by allowing application to be partitioned into several inter-connected more methods to be offloaded. MAUI minimizes state software modules using the R-OSGi module manage- transfer by only sending the difference in application ment tool. The authors expect that application develop- state on subsequent method call invocations. However, ers could take up to a month to adapt their applications MAUI serializes the application state using XML which to be compatible with their solution. is much slower than binary serialization and results in COMET [25] is a runtime system that performs of- data that is much larger [27]. MAUI uses a custom com- floading with Distributed Shared Memory (DSM). DSM piler to insert offloading logic into an application, which provides a virtual shared memory space that is accessible generates two separate code bases — one for the mobile by threads on different machines without any work device and one for the server. Custom compilation may on the part of the developer. The advantage of this complicate debugging for the application developer. approach is that fine-grained parallel algorithms can be CloneCloud’s [18] approach is to migrate the Virtual offloaded to multiple machines, resulting in improved Machine (VM) on which the application is running. It performance. The downside of the DSM approach is that migrates the VM from an Android phone to a server.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    13 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us