JDK-8014513 : Sjavac doesn't detect 32-bit jvm properly
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-05-14
  • Updated: 2013-07-11
  • Resolved: 2013-06-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b98Fixed
Related Reports
Relates :  
Description
Sjavac tries to size its working size depending on available memory and if it's running in a 32 bit or 64 bit jvm. The detection for 32bit is flawed and misses several cases. With this patch it's covering a lot more cases:

diff -r ec434cfd2752 src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java 
--- a/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java 
+++ b/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java 
@@ -136,7 +136,9 @@ 
         // for each compile..... 
         int kbPerFile = 175; 
         String osarch = System.getProperty("os.arch"); 
- if (osarch.equals("i386")) { 
+ String dataModel = System.getProperty("sun.arch.data.model"); 
+ if (dataModel.equals("32") || osarch.equals("i386") 
+ || osarch.equals("x86") || osarch.equals("sparc")) { 
             // For 32 bit platforms, assume it is slightly smaller 
             // because of smaller object headers and pointers. 
             kbPerFile = 119; 

Adding this is required for sjavac to function properly on several platforms in jprt.
Comments
While the above patch works reasonably well, it's actually not correct. The checks above are done in the client process, which isn't necessarily 64bit just because the server process is. A proper solution would need to add an api call to the sjavac server to get it's 32/64-bit status.
15-05-2013