Re: [Sablevm-developer] Re: [Sablevm-bugs] [ sablevm-Bugs-663270 ] [jni: fatal error (Local referen
Brought to you by:
egagnon
From: Archie C. <ar...@de...> - 2003-01-07 06:00:06
|
Etienne M. Gagnon wrote: > This seems to be a local reference leak in Classpath... The JNI > specification says that a VM automatically reserves at least 16 local > references. To use additional references, the EnsureLocalCapacity() > JNI function is available and shoould be called. > > See: > http://java.sun.com/products/jdk/1.2/docs/guide/jni/jni-12.html#EnsureLocalCapacity > > A VM is *NOT* required to provide any more than 16 native references, > by default, and can halt abruptly by calling FatalError() if it cannot > create more locals. [OK, there's a note about backward compatibility, > but my understanding is that this is for the JDK, not for every > possible VM]. > > SableVM is simply strict in its implementation of the JNI spec (which > simplifies local reference management a little). Ah, I didn't realize that there was a limit... the last time I read that spec was a few years ago before there was one! :-) This is something very basic though. It turns out that it only depends on the number of command line arguments, you don't even have to execute any application Java. For example: $ sablevm asdf sadf asdf sad sadf sadf adsf sdf asdf asdf asdf asfd asdf [jni: fatal error (Local reference capacity exceeded)] This is probably something to do with the way "sablevm" uses the invocation interface to start things up. As it stands, you can't give sablevm more than 12 command line arguments (including the main() class name). Cheers, -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com |