Reland "Allocate dex cache arrays at startup."

This reverts commit cc97f11fe689c1344bb04ab85e8bdc7baaeb3fb1.

Reason for revert: be more selective when using full arrays.

Test: test.py

Change-Id: If941e81849d9e3b2c4ddcc03e46fb8442a608c82
7 files changed