Initialization of static data in Java

Brian Miller bnmille@uswest.com
Thu Nov 19 15:44:00 GMT 1998


Jon Olson wrote:
>> Without the `final', the compiler could just maintain a reference
> within the object that gets overridden by subclasses.

I'm not sure exactly what optimization is being claimed here. Note
that a final array's elements are not final. This is akin to C++'s
" * const ", not C++'s " const * ".
> If you give gcj that java/lang/Character.class file, it runs out of 
> virtual memory trying to optimize all the table initialization.

It's not just Character which has a huge initialized array, but also 
its helpers. In JDK 1.1.7A the size of Character.class is 16K. But
it has 47 undocumented helper classes in package sun.io which are even 
bigger. Ten of those exceed 100K in size.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /