Disable app image for very large apps

App images prevent dex2oat unloading and should not be used in this
mode. Disable app image generation when very large app mode is
detected.

Bug: 63467744
Test: test-art-host-gtest-dex2oat_test

(cherry picked from commit df8a96a1cde9dafbb1811358be1fbba6d3aec267)

Change-Id: Icd5b0d9d3e61ececffe60f7472aaee8a54d1847b
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index e3e0180..7ba165e 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -1665,6 +1665,9 @@
 
     // If we need to downgrade the compiler-filter for size reasons.
     if (!IsBootImage() && IsVeryLarge(dex_files_)) {
+      // Disable app image to make sure dex2oat unloading is enabled.
+      compiler_options_->DisableAppImage();
+
       // If we need to downgrade the compiler-filter for size reasons, do that early before we read
       // it below for creating verification callbacks.
       if (!CompilerFilter::IsAsGoodAs(kLargeAppFilter, compiler_options_->GetCompilerFilter())) {