java - Cannot run a 64-bit JVM in 64-bit Windows 7 with a large heap size -
this 64-bit windows 7 enterprise , 64-bit java 7:
java version "1.7.0_04" java(tm) se runtime environment (build 1.7.0_04-b20) java hotspot(tm) 64-bit server vm (build 23.0-b21, mixed mode) this happens using shell of both c:\windows\systemwow64\cmd.exe (which incorrectly thought 64-bit version) and c:\windows\system32\cmd.exe (which have found out, courtesy of pulsar, 64-bit application despite path name).
the program trivial:
public class trivial { public static void main(string[] args) { system.out.println("total = " + tomb(runtime.getruntime().totalmemory())); system.out.println("max = " + tomb(runtime.getruntime().maxmemory())); } private static long tomb(long bytes) { return bytes / (1024l * 1024l); } } i fooling around different -xmx , -xms arguments see happen. have though 64-bit java on 64-bit windows use pretty whatever size max , initial heap wanted, that's not what's happening.
java -xmx16g -xms2g trivial (for example) works fine. however, java -xmx16g -xms4g trivial gives me:
error occurred during initialization of vm not reserve enough space object heap weirder (to me), java -xmx16g -xms3g trivial gives different error:
error occurred during initialization of vm unable allocate tables parallel garbage collection requested heap size. error: not create java virtual machine. error: fatal exception has occurred. program exit. attempting split difference between 2g , 3g see if there specific size happened tried java -xmx16g -xms2900m trivial , worked. tried -xms2960m , worked. -xms2970m jvm crashed:
# # there insufficient memory java runtime environment continue. # native memory allocation (malloc) failed allocate 1048576 bytes e in c:\jdk7u2_64p\jdk7u4\hotspot\src\share\vm\utilities/taskqueue.hpp # error report file more information saved as: # c:\users\quantummechanic\temp\hs_err_pid10780.log that continued until -xms2995m when switched "unable allocate tables parallel garbage collection" message , stuck -xms increased further.
what going on? launching cmd.exe (even 64-bit one) impose process size limits? windows (or jvm) requiring single huge memory block? (but why different messages)? else?
in 64-bit system, have 2^63bytes of user address space, can still map amount of actual memory have (physical + page file + mapped files).
when jvm creates heap, it's using c malloc() request initial chunk of memory , going manage chunk by itself. if don't have object on heap @ all, os chunk being used.
since specified -xms, minimum value of memory pool, jvm try require amount of memory os or fail can't satisfy command.
i guess if want see advantage of 64 bit java. maybe can try opening file larger 4gb random access , map mappedbytebuffer.
Comments
Post a Comment