I'm developing an application that generates and compiles classes at runtime. This will sometimes create huge amounts of generated code.
With one of our test cases, I'm getting an error from the JVM:
TestClass.java:83865: too many constants
Just this. I've seen other reports about a similar error, but on those cases the error message complains about the constant pool. But in this case it doesn't.
If this means that the limit on the JVM's constant pool was reached, what does it mean? I mean, what kind of constants are these in terms of Java code? Class methods? Fields? Literals? I have no static or final methods nor fields.
Can you give me some leads?
EDIT:
Splitting the code into multiple classes is already in schedule. Although it wasn't for this exact reason.
I' aware of the limits of the constant pool, my doubt was exactly what goes into into. The generated code doesn't have more that about 10000 methods+fields.
My doubt is if literals also go to the constant pool or not, since that's the only reason I see to raise this number up to 65K. It seems so.