Why we need to modify the existing Java virtual machine for mobile platform applications?

We need to modify the existing Java virtual machine for the mobile platform because of low battery power, low processing power and it needs to run on less processor power and less and limited resources when compared with the personal computer.

JVM was modified for Android OS of power management, binding, an earlier version of the android named it Dalvik. Java source code is get compiled with java bytecode and by using Dex compiler java bytecode is get compiled into Dalvik bytecode.

Dalvik bytecode is optimized code as compared with Java bytecode, it takes less memory to run and is suitable for the embedded devices where we have limited memory and processing power. All applications written in Java are converted into the Dalvik executable .dex and every android app runs its own process with its own instance of Dalvik virtual machine which provides security.

Android kernel was improved the binding and power management features than Linux. Android power management is built on top of standard Linux power management and supports more aggressive power management. Power management supports several types of “Wake Locks”, applications make requests to keep the power through “Wake Locks” and if there are no active wake locks then CPU will be turn off and if there are partial wake locks then screen and keyboard will be turned off as shown below

There are several types of wake locks

  1. ACQUIRE_CAUSES_WAKEUP
  2. FULL_WAKE_LOCK
  3. ON_AFTER_RELEASE
  4. PARTIAL_WAKE_LOCK
  5. SCREEN_BRIGHT_WAKE_LOCK
  6. SCREEN_DIM_WAKE_LOCK

Android uses native OS C libraries but some libraries are not used or modified for example glib c library. Android uses paging and Memory Mapping(mmapping) to manage memory and it does not support swapping as we have in Windows and Linux environments. Memory mapping is used to map image and data files into process address space. Garbage collection is done by using Mark Sweep Algorithm.

App Switching Mechanism:

When a user launches the app a process is created and when the user leaves the app process is not quit, the system keeps the cached, so if the user later returns to the app the process is reused for faster app switching.

Active process have critical priority and background and empty process have low priority and OS detects the processes which are not used for many days and suggest to the user to close the app so space can be free and resources can be released. Visible process and started services process have high priority.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: