Default heap sizes of different JVMs

This simple test was run with the different JVMs:

public class mem {
    public static void main(String[] argv) {
        Runtime r = Runtime.getRuntime();
        System.out.println("max  : " + r.maxMemory());
        System.out.println("total: " + r.totalMemory());
        System.out.println("free : " + r.freeMemory());
    }
}

Proprietary Runtimes

IBM JDK

java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM build cxia321420-20040626 (JIT enabled: jitc))

max  : 530675712
total: 4323840
free : 3361304

IBM J9

java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pxi32dev-20051104)
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32 j9vmxi3223-20051103 (JIT enabled)
J9VM - 20051027_03723_lHdSMR
JIT  - 20051027_1437_r8
GC   - 20051020_AA)
JCL  - 20051102

max  : 1061351424
total: 4194304
free : 3818616

Sun JDK 1.4

java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

max  : 66650112
total: 2031616
free : 1905112

Sun JDK 1.5

java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

max  : 66650112
total: 2031616
free : 1860840

BEA JRockit

java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
BEA JRockit(R) (build R26.0.0-189-53463-1.5.0_04-20051122-2040-linux-ia32, )

max  : 796012544
total: 37818368
free : 33624128

Free Runtimes

GCJ

gij (GNU libgcj) version 4.1.0 (Debian 4.1.0-1)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

max  : 9223372036854775807
total: 360448
free : 32768

JamVM

java version "1.4.2"
JamVM version 1.4.3

<snip>

max  : 134217720
total: 2097144
free : 1938456

Kaffe

java full version "kaffe-1.4.2"

kaffe VM "1.1.7"

<snip>

Engine: Just-in-time v3   Version: 1.1.7   Java Version: 1.4
Heap defaults: minimum size: 5 MB, maximum size: unlimited
Stack default size: 256 KB

max  : 9223372036854775807
total: 5246976
free : 2336237

SableVM

SableVM version 1.13
- compile date and time: 2006-02-15 18:42:06 UTC
- gcc version: 4.0.3 20051201 (prerelease) (Debian 4.0.2-5)
- 'real life brokenness' features enabled
- signal based exception detection
- copying garbage collection
- bidirectional object layout
- inline-threaded interpreter

max  : 9223372036854775807
total: 16777200
free : 16513528

cacaowiki: DefaultHeapSize (last edited 2006-05-25 12:23:23 by ChristianThalinger)