diff -Nru openjdk.orig/hotspot/make/linux/makefiles/rules.make openjdk/hotspot/make/linux/makefiles/rules.make
--- openjdk.orig/hotspot/make/linux/makefiles/rules.make	2012-06-08 17:13:09.000000000 +0100
+++ openjdk/hotspot/make/linux/makefiles/rules.make	2012-06-12 10:50:20.982290377 +0100
@@ -128,7 +128,7 @@
 # Settings for javac
 BOOT_SOURCE_LANGUAGE_VERSION = 6
 BOOT_TARGET_CLASS_VERSION = 6
-JAVAC_FLAGS = -g -encoding ascii
+JAVAC_FLAGS = -g -encoding ascii -J-Xmx512m
 BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
 
 # With parallel makes, print a message at the end of compilation.
diff -Nru openjdk.orig/hotspot/make/solaris/makefiles/rules.make openjdk/hotspot/make/solaris/makefiles/rules.make
--- openjdk.orig/hotspot/make/solaris/makefiles/rules.make	2012-06-08 17:13:09.000000000 +0100
+++ openjdk/hotspot/make/solaris/makefiles/rules.make	2012-06-12 10:50:20.982290377 +0100
@@ -120,7 +120,7 @@
 # Settings for javac
 BOOT_SOURCE_LANGUAGE_VERSION = 6
 BOOT_TARGET_CLASS_VERSION = 6
-JAVAC_FLAGS = -g -encoding ascii
+JAVAC_FLAGS = -g -encoding ascii -J-Xmx512m
 BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
 
 # With parallel makes, print a message at the end of compilation.
diff -Nru openjdk.orig/hotspot/make/windows/makefiles/rules.make openjdk/hotspot/make/windows/makefiles/rules.make
--- openjdk.orig/hotspot/make/windows/makefiles/rules.make	2012-06-08 17:13:09.000000000 +0100
+++ openjdk/hotspot/make/windows/makefiles/rules.make	2012-06-12 10:50:20.982290377 +0100
@@ -45,7 +45,7 @@
 # Settings for javac
 BOOT_SOURCE_LANGUAGE_VERSION=6
 BOOT_TARGET_CLASS_VERSION=6
-JAVAC_FLAGS=-g -encoding ascii
+JAVAC_FLAGS=-g -encoding ascii -J-Xmx512m
 BOOTSTRAP_JAVAC_FLAGS=$(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
 
 ProjectFile=jvm.vcproj
diff -Nru openjdk.orig/jdk/make/common/shared/Platform.gmk openjdk/jdk/make/common/shared/Platform.gmk
--- openjdk.orig/jdk/make/common/shared/Platform.gmk	2012-06-08 17:12:17.000000000 +0100
+++ openjdk/jdk/make/common/shared/Platform.gmk	2012-06-12 10:50:20.982290377 +0100
@@ -537,7 +537,7 @@
       else \
         echo "false"; \
       fi)
-    MAX_VM_MEMORY := 512
+    MAX_VM_MEMORY := 1792
     MIN_VM_MEMORY := $(MAX_VM_MEMORY)
   else
     MB_OF_MEMORY       := unknown
diff -Nru openjdk.orig/jdk/make/docs/Makefile openjdk/jdk/make/docs/Makefile
--- openjdk.orig/jdk/make/docs/Makefile	2015-11-30 05:07:07.728000000 -0800
+++ openjdk/jdk/make/docs/Makefile	2015-11-30 05:07:47.064000000 -0800
@@ -68,13 +68,7 @@
 # We override whatever the max VM memory setting is here.
 #    NOTE: javadoc will not complete without these larger settings.
 #    WARNING: This could cause thrashing on low memory machines.
-ifeq ($(ARCH_DATA_MODEL),64)
-  MAX_VM_MEMORY = 1536
-else ifeq ($(ARCH),universal)
-  MAX_VM_MEMORY = 1536
-else
-  MAX_VM_MEMORY = 768
-endif
+MAX_VM_MEMORY = 2048
 
 # List of all possible directories for javadoc to look for sources
 #    NOTE: Quotes are required around sourcepath argument only on Windows.
diff -Nru openjdk.orig/langtools/make/build.xml openjdk/langtools/make/build.xml
--- openjdk.orig/langtools/make/build.xml	2012-06-08 17:12:36.000000000 +0100
+++ openjdk/langtools/make/build.xml	2012-06-12 10:50:20.974290246 +0100
@@ -796,6 +796,7 @@
                     <compilerarg value="-implicit:none"/>
                     <compilerarg value="-Xprefer:source"/>
                     <compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/>
+		     <compilerarg value="-J-Xmx256M"/>
                     <compilerarg line="@{bootclasspath.opt}"/>
                     <compilerarg line="${javac.no.jdk.warnings}"/>
                     <compilerarg line="${javac.version.opt}"/>
diff -Nru openjdk.orig/hotspot/make/bsd/makefiles/rules.make openjdk/hotspot/make/bsd/makefiles/rules.make
--- openjdk.orig/hotspot/make/bsd/makefiles/rules.make	2012-06-08 17:13:09.000000000 +0100
+++ openjdk/hotspot/make/bsd/makefiles/rules.make	2012-06-12 10:50:20.974290246 +0100
@@ -128,7 +128,7 @@
 # Settings for javac
 BOOT_SOURCE_LANGUAGE_VERSION = 6
 BOOT_TARGET_CLASS_VERSION = 6
-JAVAC_FLAGS = -g -encoding ascii
+JAVAC_FLAGS = -g -encoding ascii -J-Xmx512m
 BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
 
 # With parallel makes, print a message at the end of compilation.
