JDK-4473053 : The JRE switch '-Xmx' should NOT be necessary
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2001-06-21
  • Updated: 2002-02-11
  • Resolved: 2002-02-11
Related Reports
Duplicate :  
Description

Name: krC82822			Date: 06/21/2001


21 Jun 2001, eval1127@eng -- see also # 4122060 and:
http://search.java.sun.com/Search/java?qt=%2Bruntime+%2B%22-Xmx%22+%2Brequired&col=obug&rf=0
--------------
C:\users\dcook>java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

For cmd-line client pgms written in Java, the need for
the use of the '-Xmx' switch should be eliminated!  Users
who will launch such programs should NOT have to guess what the
heap requirements of the program will be.

Here's a reproducer:

public class VMexpansion
{
 
    public VMexpansion()
    {
    }
 
    public static void usage()
    {
        System.err.println("Usage: <integerFactor>");
        System.err.println("[Hint: Prepend JRE switch like '-Xmx80m' if
OutOfMemoryErrors occur.]");
        System.err.println("[Hint: try specifying a cmd-line factor of 80]");
        System.err.println("[Hint: then, try specifying a cmd-line factor of 90
and use -Xmx80m]");
        System.err.println("[Hint: See...the V1.3 JVM's behavior is brain-
dead!  Users should NOT have to know about -Xmx switch.]");
        System.exit(-1);
    }
 
    public static void main(String[] argv)
    {
        VMexpansion VMexpansion1 = new VMexpansion();
 
        if (argv.length < 1)
            usage();
        int factor = Integer.parseInt(argv[0]);
        int million = 1000000;
 
        byte[] heap = new byte[factor * million];
    }
}
(Review ID: 127113) 
======================================================================

Comments
WORK AROUND Name: krC82822 Date: 06/21/2001 User can GUESS. If user guesses too small, then the program dies. ======================================================================
11-06-2004

EVALUATION ###@###.### 2002-02-11 Duplicate of 4408373, which also requests that the fixed upper heap limit be removed.
11-02-2002