Tipos de memoria de Android (RAM v memoria interna)

En un hilo separado I demonstrated my ignorance of memory types by asking about the best way to copy a file into "internal memory" and was advised that this was not a good idea and that it would be better to read the file into "RAM". I am now trying to understand how these two types of memory are related and how they can be used.

I understand that "internal memory is perceived to be the flash that is used to store APKs, ROM images, etc."

The specification for my HTC Hero says that there is "ROM: 512MB, RAM: 288MB" with no indication of how the RAM is subdivided.

On the phone the "Settings"->"SD & phone storage" page simply refers to "SD card" and "Internal phone storage" and for the latter just shows one amount for "Available space".

The Android Reference for Almacenamiento de datos mentions "Internal Storage". This is a place where "you can save files". The page also mentions SQLite database files which I think can be stored in the "Internal storage". However, the page doesn't seem to offer any explanation of the sub-division of RAM between Internal Storage and another (presumably more dynamic) type.

Is there some kind of dynamic division of the total RAM (288MB on the Hero) into two sub-divisions which are usable in different ways? If so, where in the Android documentation is this explained?

preguntado el 08 de enero de 11 a las 16:01

1 Respuestas

I understand that "internal memory is perceived to be the flash that is used to store APKs, ROM images, etc."

The specification for my HTC Hero says that there is "ROM: 512MB, RAM: 288MB" with no indication of how the RAM is subdivided.

The RAM is not "subdivided" on any sort of permanent basis. RAM is used by running processes on an as-needed basis. The biggest thing for SDK apps to note is that there is an upper bound as to how much RAM a process can consume -- on your Hero, it should be 16MB.

On the phone the "Settings"->"SD & phone storage" page simply refers to "SD card" and "Internal phone storage" and for the latter just shows one amount for "Available space".

The "Internal phone storage" refers to the portion of on-board flash space set aside for APK files, databases, preferences, and other local files.

The page also mentions SQLite database files which I think can be stored in the "Internal storage".

Correcto.

However, the page doesn't seem to offer any explanation of the sub-division of RAM between Internal Storage and another (presumably more dynamic) type.

RAM has nothing to do with internal storage.

Is there some kind of dynamic division of the total RAM (288MB on the Hero) into two sub-divisions which are usable in different ways?

No.


Let's step back a pace.

RAM is RAM is RAM. RAM on your phone is not significantly different than RAM on your desktop, your notebook, your netbook, etc. This construct has remained relatively stable in its use for the past few decades, particularly once we escaped from the mainframe. Running programs (OS and end-user apps) consume RAM, but only while they are running. And RAM gets wiped on a reboot, on phones as much as on your desktop.

Now, your average desktop, notebook, or netbook also has a hard drive for more permanent storage than RAM offers. There is no absolute term for the equivalent in Android -- I tend to use "on-board flash storage" for it, others call it "internal storage", though as you will see, the latter term is fraught with confusion. Just like a hard drive, on-board flash storage is used for the OS (a.k.a., firmware in Android), end-user programs (a.k.a., APK files in Android), and end-user data (a.k.a., databases, shared preferences, and other files stored where getFilesDir() is located).

The on-board flash storage is divided into a few partitions. If you're a Windows user, partitions is basically saying "your hard drive is broken into C:, E:, and F: drives". In Android, one partition is dedicated to firmware, and another partition (the "data partition") is dedicated to the end-user programs and data. (NOTE: the preceding description is not entirely accurate, but the discrepancies are well beyond the scope of this answer).

So, with all that in mind:

  • Your 512MB of ROM is the on-board flash storage, hearkening back to the old "flash ROM" term
  • Your "Internal phone storage" in settings it the available space in the data partition for end-user apps and data (one of the reasons why I don't use this term to refer to the on-board flash storage as a whole)
  • Your "SD card" is more generically referred to in Android as external storage, which on many devices is some form of SD card, though it could actually be just another partition of the on-board flash storage designated as serving in the role of external storage

Respondido el 20 de junio de 20 a las 12:06

Thanks very much indeed for this speedy and very helpful answer. I think one thing that particularly confused me was that I assumed that the ("read-only") ROM was not writeable. (If this is flash RAM, I must say ROM is a very confusing way to describe it!) Do I understand correctly that the "SD & phone storage" shown in my phone's Settings refers to part of the "ROM" and that the Settings pages provide no information about RAM? Is the management of RAM left completely to the Operating System and is it completely invisible to the user and programmer? - prepbgg

The Wikipedia article on "Read-only memory" says "more modern types such as EPROM and flash EEPROM can be erased and re-programmed multiple times; they are still described as "read-only memory"(ROM)[citation needed] because the reprogramming process is generally infrequent, comparatively slow, and often does not permit random access writes to individual memory locations." I can see why I assumed that this would NO be the place where user data is stored! - prepbgg

@prepbgg: "If this is flash RAM, I must say ROM is a very confusing way to describe it!" -- there is no such thing as "flash RAM" AFAIK. "Do I understand correctly that the "SD & phone storage" shown in my phone's Settings refers to part of the "ROM" and that the Settings pages provide no information about RAM?" -- correct. "Is the management of RAM left completely to the Operating System and is it completely invisible to the user and programmer?" -- generally, yes. - CommonsWare

@prepbgg: "I can see why I assumed that this would NOT be the place where user data is stored!" -- flash has been used for storage commonly for about 15 years. See en.wikipedia.org/wiki/Flash_storage. - CommonsWare

I'm trying to connect your answer with this link : addictivetips.com/mobile/… So, the partitions in the link must be the partitions of ROM (flash storage) you mention. - Jake

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.