Analysis of Mauve failures - The final chapter

Boehm, Hans hans_boehm@hp.com
Mon Apr 8 15:20:00 GMT 2002


The "Out of Memory!  Returning NIL!" message ia a GC warning.  The patch I'm
about to check in will make that clearer.  It should not prevent the
exception from being thrown.

There is a strong argument that this warning should be turned off for gcj
once we're convinced that the exception is actually delivered correctly in
this case.  I think on some platforms that will be quite hard, since
throwing an exception may involve reading debug information, which allocates
lots of memory.

Hans

> -----Original Message-----
> From: Tom Tromey [mailto:tromey@redhat.com]
> Sent: Monday, April 08, 2002 1:35 PM
> To: Mark Wielaard
> Cc: java@gcc.gnu.org
> Subject: Re: Analysis of Mauve failures - The final chapter
> 
> 
> >>>>> "Mark" == Mark Wielaard <mark@klomp.org> writes:
> 
> Mark> import java.lang.reflect.Array;
> Mark> public class Big
> Mark> {
> Mark>   public static void main(String[] args)
> Mark>   {
> Mark>     String[][] t = (String[][]) Array.newInstance(String.class,
> Mark>                     new int[] {Integer.MAX_VALUE, 
> Integer.MAX_VALUE});
> Mark>     System.out.println(t.length);
> Mark>   }
> Mark> }
> 
> I tried this.  I get this result:
> 
>     creche. gcj --main=Big -o Big Big.java 
> -Wl,-rpath,/x1/gcc3/install/lib
>     creche. ./Big
>     Out of Memory!  Returning NIL!
> 
> This isn't what I expected.  I expected OutOfMemoryError to be thrown
> and a stack trace to be printed.
> 
> I definitely didn't see the failure that you report.
> 
> Mark> It seems to me that something like the following is needed since
> Mark> the Class type does not have to be an array class with
> Mark> Array.newInstanceOf()
> 
> In Array.newInstance(Class,int[]) we compute the array type, which we
> then pass to _Jv_NewMultiArray:
> 
>   jclass arrayType = componentType;
>   for (int i = 0;  i < ndims;  i++)  // FIXME 2nd arg should 
>                                      // be "current" loader
>     arrayType = _Jv_GetArrayClass (arrayType, 0);
> 
> So I don't think this patch is necessary.  I think something else is
> going on here.  What do you think?
> 
> Tom
> 



More information about the Java mailing list