1

I'm developing an apk for android (java, ionic, angular JS,...) running over a development board (UDOO QUAD) but I'm having problems of performance when scrolling screens with high quality images or data updated in "real time".

I suspect that my problem is that my apk is running from SD card which is a slow device. So I have to major questions, the first one is for my personal knowledge and the second one is the main question of this post.

1.- When an APK is started, how does it work, is all the apk copied to RAM, what are the timings?

2.- I've search all around internet for a method for copying at apk start all the data to RAM for increase performance, but I haven't found a procedure to do this.

Does anybody know a way to do this?

Thanks, Guillermo

taquionbcn
  • 543
  • 1
  • 8
  • 25

1 Answers1

1

When an installed application actually runs, it's already loaded into RAM, always. That's the purpose of RAM after all.

But if you load some external data to application, like high quality images as in your case, you might expect some loading time sure, but those things are being perfected on the coding level.

As for your questions:

  1. As stated before, when the app process is running, it's code is already converted to compiled native code, which ultimately runs in working memory. If you want to understand the compiling process (of how the machine code is obtained) in more detail, try starting with this resource

  2. irrelevant, because of 1.

Bottom line is, running the app from SD card shouldn't have nothing to do with your problem, I would be looking for solution elsewhere. Let the OS manage it's resources by itself.

Community
  • 1
  • 1
MVojtkovszky
  • 519
  • 4
  • 11
  • UDOO QUAD is a Freescale i.MX 6 ARM Cortex-A9 Quad core 1GHz what should be more than enough to move the application. Maybe GPU Vivante GC 2000 + Vivante GC 355 + Vivante GC 320 is not the best but is not so bad for what is already programmed. The images are inserted while programming under android studio so are inside apk. Android loads all the APK to RAM or it loads the parts of APK under demand? – taquionbcn Sep 21 '15 at 11:51
  • It doesn't load everything that APK "contains" to memory at once, only on demand (like resources, fragments) when it needs them. That includes your images if inside APK. But it also clears them automatically when the memory is running low or on garbage collect. – MVojtkovszky Sep 21 '15 at 11:59
  • And is there any way to force some of the items to stay in RAM? not all the apk but this heavy images? stay or preload – taquionbcn Sep 21 '15 at 14:33
  • Yes, You could reference those resources by extending Application class and keep a static references there, that will prevent them from being cleared from memory, as long as the class in is use (for Application class that means for as long as the app is running). – MVojtkovszky Sep 22 '15 at 10:58