Hi,
I think I must misunderstand what you are saying about array sizes but I very often
initilise arrays with MUCH more than 7000
elements. The following code fills a double array with a million random doubles in one
method with no issues.
Cheers,
Brad
public class Test {
public Test() {
aMethod();
}
private void aMethod() {
double[] testa = new double[1000000];
for (int i = 0; i < testa.length; i++) {
testa[i] = Math.random();
System.out.print(".");
}
System.out.println("");
System.out.println("Done");
}
public static void main(String[] args) {
new Test();
}
}
Artur Biesiadowski wrote:
>
> Philip J Colbert wrote:
>
> > Hi all
> >
> > I have a class that is just basically a extension from an object that
> > returns
> > a shape3D. In this class all I do is set the Ceometry and Coord Index
> > for a
> > shape ("Yes I know it is large but I don't see why there is a
> > problem") The
> > geometry is large and has over 1000 points in it! The runtime error I
> > get is
> > below and the line that calls it is just a basic call to a constructor.
>
> In current version of java there is a 64k limit on method side.
> Unfortunately, array initialization takes up a lot of space (I'm shocked
> that 7 years have passed and we still do not have special constant for
> arrays inside classfile).
>
> Anyway, for each array element, you need
> aload array
> bipush index
> ldc2 float_data
> fastore
>
> This is 1 + 3 + 3 + 1 = 8 bytes per element. This means that you can
> have around 7000 entries in array at most. 1000 points means 3000
> coordinates. If you also have colors and indices you can easily go over
> 7000 limit.
>
> Solution is to load data from external file. It will be probably faster,
> less stressing for jit/jvm, easier to modify and you will not have to
> worry about method size. Compile time should also get shorter :)
>
> Artur
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA3D-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
----------------------------------------------------------------------------
This Email may contain confidential and/or privileged information and is
intended solely for the addressee(s) named. If you have received this
information in error, or are advised that you have been posted this Email by
accident, please notify the sender by return Email, do not redistribute it,
delete the Email and keep no copies.
----------------------------------------------------------------------------
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".