Reputation: 5325
While going through the android docs for Memory Management, I came across this particular section for Sharing memory across processes.
I am not able to understand the second point here:
Most static data is mmapped into a process. This technique allows data to be shared between processes, and also allows it to be paged out when needed. Example static data include: Dalvik code (by placing it in a pre-linked .odex file for direct mmapping), app resources (by designing the resource table to be a structure that can be mmapped and by aligning the zip entries of the APK), and traditional project elements like native code in .so files
I understand what mmapping
is. The things that are mentioned in this point are dalvik code for that app, app resources : why will these be shared with other apps?
Can someone please give an example scenario where this statement makes sense?
Upvotes: 1
Views: 798
Reputation: 95618
Dalvik code is the code for your application. This code is static and never changes. Also, resources can be shared among processes as they are also static and never change. It is possible for one application to have different components running in different OS processes. In this case, sharing all the application code and resources saves real memory.
Upvotes: 1