How is memory allocated between the JVM and its own process?
The Sun JVM garbage collector has a mark-and-sweep function, with the ability to enable parallel and incremental GC.
Well, more precisely, it was delivered, and above this applies only to long-lived objects. For young objects, GC is still executed using the stop copy collector, which is much better for working with short-lived objects (and all typical Java programs create many short-lived objects).
The copy collector moves over all elements of the heap, copying them to a new heap if they are referenced, and then deletes the old heap. Thus, 1M live objects require up to 2M real memory: if each object is alive, there will be two copies during garbage collection.
Thus, the JVM requires much more system memory than is available for code running on the VM, because there is significant overhead for managing and garbage collection.
Does the Windows / 3GB switch have any effect with native processes and the Sun JVM?
/3GB allows the address space of the user's virtual memory to be 3 GB, but only for executable files whose headers are marked IMAGE_FILE_LARGE_ADDRESS_AWARE . As far as I know, Sun java.exe is not. I do not have a Windows system, so I can not check.
source share