I am developing an application that generates and compiles classes at runtime. This sometimes creates a huge amount of generated code.
In one of our test cases, I get a JVM error message:
TestClass.java:83865: too many constants
Just this. I saw other messages about a similar error, but in those cases the error message complains about a constant pool. But in this case it is not so.
If this means that the limit in the JVM constant pool has been reached, what does it mean? I mean, what are these constants in the sense of Java code? Class methods Fields? Literals? I have no static or final methods and fields.
Can you give me some results?
EDIT:
Separation of the code into several classes is already in progress. Although it was not for this reason.
I know the limits of the constant pool, my doubt was exactly what was happening. The generated code does not contain more than 10,000 labels + fields.
My doubt is that literals also go to a constant pool or not, as this is the only reason I can raise this number to 65K. It seems so.
halfwarp
source share