Reduce memory usage.

Also, fix InferredRegCategoryMap constructor. (The regs_size is uint16_t.)

Change-Id: If85df1ad78c3acc6d3c19e605ee7d90f43df1159
diff --git a/src/compiler_llvm/compilation_unit.h b/src/compiler_llvm/compilation_unit.h
index 52e4ae6..d391620 100644
--- a/src/compiler_llvm/compilation_unit.h
+++ b/src/compiler_llvm/compilation_unit.h
@@ -102,7 +102,7 @@
 
   bool IsMaterializeThresholdReached() const {
     MutexLock GUARD(cunit_lock_);
-    return (mem_usage_ > 5000000u); // (threshold: 5 MB)
+    return (mem_usage_ > 1000000u); // (threshold: 1 MB)
   }
 
   void AddMemUsageApproximation(size_t usage) {
@@ -128,7 +128,8 @@
   std::string bitcode_filename_;
   std::string elf_image_;
 
-  SafeMap<const llvm::Function*, CompiledMethod*> compiled_methods_map_;
+  typedef SafeMap<const llvm::Function*, CompiledMethod*> CompiledMethodMap;
+  UniquePtr<CompiledMethodMap> compiled_methods_map_;
 
   size_t mem_usage_;
   uint16_t num_elf_funcs_;