title: Android source code compile error: "Try increasing heap size with java option '-Xmx<size>'"
body: <p>Error happens when I try to compile Android source code(Sourcecode-version: 6.0.1; RAM: 6G; host system: ubuntu 14.04),log is below:</p>
  
  <pre><code>including ./system/netd/Android.mk ...
  including ./system/security/keystore-engine/Android.mk ...
  including ./system/security/keystore/Android.mk ...
  including ./system/security/softkeymaster/Android.mk ...
  including ./system/tools/aidl/Android.mk ...
  including ./system/update_engine/Android.mk ...
  including ./system/vold/Android.mk ...
  including ./system/weaved/Android.mk ...
  including ./system/webservd/Android.mk ...
  including ./tools/external/fat32lib/Android.mk ...
  Starting build with ninja
  ninja: Entering directory `.'
  [  0% 1/21275] Ensure Jack server is installed and started
  Jack server already installed in "/home/eddy/.jack-server"
  Launching Jack server java -Djava.io.tmpdir=/tmp -Dfile.encoding=UTF-8 -XX:+TieredCompilation -cp /home/eddy/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher
  [  0% 17/21275] host Java: conscrypt-host (out/host/common/obj/JAVA_LIBRARIES/conscrypt-host_intermediates/classes)
  warning: [options] bootstrap class path not set in conjunction with -source 1.7
  external/conscrypt/src/openjdk/java/org/conscrypt/Platform.java:39: warning: AlgorithmId is internal proprietary API and may be removed in a future release
  import sun.security.x509.AlgorithmId;
                          ^
  external/conscrypt/src/openjdk/java/org/conscrypt/Platform.java:243: warning: AlgorithmId is internal proprietary API and may be removed in a future release
              return AlgorithmId.get(oid).getName();
                     ^
  Note: Some input files use or override a deprecated API.
  Note: Recompile with -Xlint:deprecation for details.
  Note: Some input files use unchecked or unsafe operations.
  Note: Recompile with -Xlint:unchecked for details.
  3 warnings
  [  0% 18/21275] host Java: signapk (out/host/common/obj/JAVA_LIBRARIES/signapk_intermediates/classes)
  warning: [options] bootstrap class path not set in conjunction with -source 1.7
  1 warning
  [  0% 73/21275] Building with Jack: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex
  FAILED: /bin/bash out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
  GC overhead limit exceeded
  Try increasing heap size with java option '-Xmx&lt;size&gt;'
  Warning: This may have produced partial or corrupted output.
  ninja: build stopped: subcommand failed.
  make: *** [ninja_wrapper] Error 1
  
  #### make failed to build some targets (14:09 (mm:ss)) ####
  
  eddy@eddy-OptiPlex-390:~/WORKING_DIRECTORY$ 
  </code></pre>
  
  <p>Anyone can tell me why the compiling failed?</p>