Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4065101

javac can't compile huge arrays

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.2
    • tools
    • None
    • x86
    • windows_nt



      Name: tb29552 Date: 07/16/97


      Reported by:
      company - Trimble Navigation New Zealand Limited , email - ###@###.###

      The following source code produced an OutOfMemoryError
      exception in javac. It is probably due to the large
      number of double values being stored in the arrays.


      package COM.trimble.core.globe;

      class Map
      {
        static final double[] LAND_REGIONS =
        {
           3903, 0.810233, 0.849041,
           0.811861, 0.856427, 0.808769, 0.854828, 0.809254, 0.856815, 0.811224,
          0.860978, 0.814818, 0.865575, 0.818125, 0.871463,
          0.822728, 0.873247, 0.823493, 0.875512, 0.821360, 0.875306,
          0.826882, 0.879619, 0.831430, 0.879282, 0.836324, 0.882369,

          ... about 30,000 more double values ...
        };

        static final double[] WATER_REGIONS =
        {
          141, 0.047885, 2.389520,
           0.046883, 2.386284, 0.044715, 2.381962, 0.044348, 2.377124, 0.044248, 2.371979,
           0.046049, 2.367166, 0.046618, 2.362023, 0.048618, 2.357728, 0.052859, 2.353220,
           0.054760, 2.356360, 0.056664, 2.354778, 0.057332, 2.349702, 0.060604, 2.346182,

         ... about 5000 more double values ...
        };
      }


      Compiler output:

      [c:\devjava\src]javac COM\trimble\core\globe\Map.java
      java.lang.OutOfMemoryError:
              at java.util.Hashtable.put(Hashtable.java:352)
              at sun.tools.asm.ConstantPool.put(ConstantPool.java:68)
              at sun.tools.asm.Instruction.collect(Instruction.java:363)
              at sun.tools.asm.Assembler.collect(Assembler.java:235)
              at sun.tools.javac.SourceClass.compileClass(SourceClass.java:1441)
              at sun.tools.javac.SourceClass.compile(SourceClass.java:1297)
              at sun.tools.javac.Main.compile(Main.java:331)
              at sun.tools.javac.Main.main(Main.java:473)
      error: An error has occurred in the compiler; please file a bug report
          (http://j ava.sun.com/cgi-bin/bugreport.cgi).
      1 error
      company - Trimble Navigation New Zealand Limited , email - ###@###.###
      ======================================================================

            tturnidgsunw Todd Turnidge (Inactive)
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: