And if you don't want to load from multiple files. You can just break it
into multiple method calls as in changing to something like:

        public void oneBigMethod() {
        smallerMethod1();
        smallerMethod2();
        smallerMethod3();
        ...
        smallerMethodN();
      }

Of course you might need to do some setup or pass around some parameters but
usually it is not too tough to do this. I guess it might depend on you
specific code but I've done this before when I encountered the "method
longer than 65535 bytes" exception and it worked just fine.

Good luck,
Brian
---
Brian Kubena
NASA / Johnson Space Center
Flight Design and Dynamics Division, DM12
[EMAIL PROTECTED]
281/483-8015


-----Original Message-----
From: Artur Biesiadowski [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 20, 2002 6:39 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Method too Large! Please Explain!


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".

===========================================================================
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".

Reply via email to