This section describes a mobile application named Swapper. We developed a set of experiments in order to create
a testing scenario for our middleware. The mobile application offer a service of automatic swapping between the mobile local storage system and the external storage system
running on a server connected through Internet. Automatic
swapping allows mobile devices to release storage space in a
transparent way. We made some experiments looking for a
good replacement policy that takes into account the following issues: average storage space in current mobile devices,
average file size, average data transfer rate in common LAN
and WAN wireless networks like Wi-Fi y GPRS.
In order to choose a good replacement policy to be implemented in Swapper, we simulated four different algorithms
based on the average measures taken from real mobile devices and wireless networks. The results obtained from the
simulations help us to decide which policy replacement algorithm to implement in our Swapper application. The main
task of a replacement algorithm is to decide which file will be
sent to the external storage server to release storage space
in the local memory. The following policies were evaluated:
LRU (Least Recently Used), LFU (Least Frequently Used),
LFS (Largest File Size), SFS (Smallest File Size). The average file size obtained from diferent mobile phones was
1.3MB. Most of the file were images and music. We made
tests trying to find an optimal block size for transmission
of file regardless of the wireless network. The better results were obtained with a block size of 1KB. Particularly in
GPRS networks which have more restricted bandwidth com-
pared to WiFi and where big blocks increased packet loss.
The average time obtained of transmitting files of 1.3MB
from dierent mobiles devices to an external storage server
connected on Internet using Wi-Fi was 8.3s. This measure
helped us to calculate the average transmission time of each
algorithm in mobile devices with dierent file sizes and memory sizes. The hit ratio and average transmission time obtained in each replacement policy showed that, if the Swap-
per replaces file based on the largest file size (LFS) obtains
the best hit ratio, but it also obtains the greatest average
transmission time. These results could be a good decision
point when the cost of the wireless communication depends
on time consumption (like GMS networks). Most of the
cases the wireless communication service is calculated based
on bandwidth consumption. These simulations gave us in-
sights at the moment of deciding which algorithm could be
implemented like a caching service for our middleware, since
it is important to consider all of the costs in terms of time
and bandwidth consumption.