0

I was asked this question and also explain why it is detrimental to the android system as a whole.

I have not found a web page which refers to this specific question about Dalvik and swap space. Any links would be appreciated or an explanation.

What I have answered is

Swap space is a method of using secondary storage of the device to free up RAM. This would not work on android as it is not guaranteed that a device would have secondary storage causing the application to crash.

It is also slow to read from external storage as Dalvik is a JIT compiler this may lead to the code being compiled at a rate which is effecting the users experience with the app.

An initial decision of Dalvik was not to support swap space. Explain what swap space is and why it would be detrimental to the Android system as a whole.

5
  • 1
    Dalvik is the Android JVM (thus an program) and swap space is a feature of the OS. I a regular OS a program is never aware if it uses RAM or swap as the OS just provides memory. There are Android stock devices that are configured to have a small swap partition and of course a lot of custom ROMs make use of swap partitions. Therefore I am not sure what actually you are asking.
    – Robert
    Commented Dec 27, 2021 at 15:16
  • @Robert thanks for the reply and explanation, I will edit the question to include the original question and exactly what was asked
    – francisRH
    Commented Dec 27, 2021 at 16:14
  • As Robert said, saying that "Dalvik does not support swap space" does not make sense. Rather you can say that "Android does not support swap space". But it isn't true. Android is based on Linux kernel. And you can use a swap partition or swap file on Android exactly the same way as you'd do on a Linux PC. But you are correct in saying that Android devices by default do not use secondary storage for swap space. Instead engineers at Android decided to use ZRAM. Commented Dec 27, 2021 at 16:55
  • Some more details can be found in this answer and this comment. Commented Dec 27, 2021 at 16:55
  • "why it would be detrimental to the Android system as a whole". Quoted from the link I provided above: "embedded system normally are reluctant to use eMMC or SDCard as swap because there is wear-leveling and latency issues" and "it sometime ends up making system very unresponsive caused by slow swap storage performance". Commented Dec 27, 2021 at 17:04

0

You must log in to answer this question.

Browse other questions tagged .