 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
aloha.kakuikanu Guest
|
Posted: Fri Mar 02, 2007 3:24 am Post subject: 65535 bytes method code limit? |
|
|
I'm getting:
"The code of method mTokens() is exceeding the 65535 bytes limit"
The method is antlr generated, so I struggle to find any workaround.
Perhaps I'm missing some magic JVM parameter setting? Aren't 16 bit
integers relics of the past century? |
|
| Back to top |
|
 |
Chris Uppal Guest
|
Posted: Fri Mar 02, 2007 4:04 am Post subject: Re: 65535 bytes method code limit? |
|
|
aloha.kakuikanu wrote:
| Quote: | "The code of method mTokens() is exceeding the 65535 bytes limit"
The method is antlr generated, so I struggle to find any workaround.
Perhaps I'm missing some magic JVM parameter setting? Aren't 16 bit
integers relics of the past century?
|
It's a hard limit in Java, I'm afraid. No way around it (with current versions
of Java) because it's a limit of the classfile format itself, rather than a
limit of the Java compiler, or of the JVM.
(Actually, the limit in the classfile is rather more complicated than that, and
you can, structurally, have more than 64K bytes of bytecode per method, but
there are various auxiliary structures in the classfile which do have a 64K
limits.)
-- chris |
|
| Back to top |
|
 |
Florian Weimer Guest
|
Posted: Fri Mar 02, 2007 6:45 pm Post subject: Re: 65535 bytes method code limit? |
|
|
* aloha kakuikanu:
| Quote: | I'm getting:
"The code of method mTokens() is exceeding the 65535 bytes limit"
The method is antlr generated, so I struggle to find any workaround.
Perhaps I'm missing some magic JVM parameter setting?
|
Anything that compiles to class files in a straightforward way will
hit this limit, as Chris explained.
There are basically two workarounds: Use a compiler that synthesizes
additional classes to work around the limit (I don't know if one
exists), or a compiler that does not compile to class files, such as
an earlier GCJ version. The latter approach might work if your
intention is to get the code running. (Nowadays, GCJ uses class files
as well.) |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|