OSDN Git Service

runtime: Mmap uncompressed dex files (in zip) as clean memory
authorIgor Murashkin <iam@google.com>
Tue, 7 Feb 2017 23:20:54 +0000 (15:20 -0800)
committerIgor Murashkin <iam@google.com>
Fri, 10 Feb 2017 18:33:12 +0000 (10:33 -0800)
commit19e5f834501c5e69fbd731038b88c10332cc6bc7
tree439e382f697ed114e117d7ae21dc818f17ec8187
parente4530079672682ff3900d84c08b666a6a899d973
runtime: Mmap uncompressed dex files (in zip) as clean memory

Saves 3MB of RAM (system-wide) in AGSA (search toolbar).
Also makes 3MB of RAM clean (previously dirty).

----

classes.dex from different processes will now have
their memory shared (as clean) globally.

To take advantage of this, the app/service just
needs to build their .JARs zipaligned and with
classes.dex being stored uncompressed.

-----

classes[N].dex within ZIP files will now get memory-mapped
as file-backed, clean memory when opening a DexFile.

(The zip entry must be at least 4-byte aligned).

Compressed DEX files still get extracted first to dirty memory.

Test: art/tools/run-test 071-dexfile-map-clean
Bug: 27650033
Change-Id: I18efbd392c5980ffe0d983833b6cc581e0237b92
runtime/dex_file.cc
runtime/zip_archive.cc
runtime/zip_archive.h
test/071-dexfile-map-clean/build [new file with mode: 0755]
test/071-dexfile-map-clean/expected.txt [new file with mode: 0644]
test/071-dexfile-map-clean/info.txt [new file with mode: 0644]
test/071-dexfile-map-clean/run [new file with mode: 0755]
test/071-dexfile-map-clean/src-ex/Another.java [new file with mode: 0644]
test/071-dexfile-map-clean/src/Main.java [new file with mode: 0644]
test/etc/default-build
test/run-test