<tfoot id='2TL1N'></tfoot>

  1. <small id='2TL1N'></small><noframes id='2TL1N'>

    • <bdo id='2TL1N'></bdo><ul id='2TL1N'></ul>

    <legend id='2TL1N'><style id='2TL1N'><dir id='2TL1N'><q id='2TL1N'></q></dir></style></legend>
    <i id='2TL1N'><tr id='2TL1N'><dt id='2TL1N'><q id='2TL1N'><span id='2TL1N'><b id='2TL1N'><form id='2TL1N'><ins id='2TL1N'></ins><ul id='2TL1N'></ul><sub id='2TL1N'></sub></form><legend id='2TL1N'></legend><bdo id='2TL1N'><pre id='2TL1N'><center id='2TL1N'></center></pre></bdo></b><th id='2TL1N'></th></span></q></dt></tr></i><div id='2TL1N'><tfoot id='2TL1N'></tfoot><dl id='2TL1N'><fieldset id='2TL1N'></fieldset></dl></div>

      Java“常量太多"JVM 错误

      Java quot;too many constantsquot; JVM error(Java“常量太多JVM 错误)
    1. <i id='f5IfY'><tr id='f5IfY'><dt id='f5IfY'><q id='f5IfY'><span id='f5IfY'><b id='f5IfY'><form id='f5IfY'><ins id='f5IfY'></ins><ul id='f5IfY'></ul><sub id='f5IfY'></sub></form><legend id='f5IfY'></legend><bdo id='f5IfY'><pre id='f5IfY'><center id='f5IfY'></center></pre></bdo></b><th id='f5IfY'></th></span></q></dt></tr></i><div id='f5IfY'><tfoot id='f5IfY'></tfoot><dl id='f5IfY'><fieldset id='f5IfY'></fieldset></dl></div>
      • <legend id='f5IfY'><style id='f5IfY'><dir id='f5IfY'><q id='f5IfY'></q></dir></style></legend>
        • <bdo id='f5IfY'></bdo><ul id='f5IfY'></ul>

          <small id='f5IfY'></small><noframes id='f5IfY'>

            • <tfoot id='f5IfY'></tfoot>
                <tbody id='f5IfY'></tbody>

              1. 本文介绍了Java“常量太多"JVM 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在开发一个在运行时生成和编译类的应用程序.这有时会产生大量的生成代码.

                I'm developing an application that generates and compiles classes at runtime. This will sometimes create huge amounts of generated code.

                对于我们的一个测试用例,我从 JVM 收到一个错误:

                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.

                如果这意味着达到了 JVM 的常量池的限制,那是什么意思?我的意思是,就 Java 代码而言,这些常量是什么类型的?类方法?领域?字面意思?我没有静态或最终方法,也没有字段.

                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.

                你能给我一些线索吗?

                将代码拆分为多个类已在计划中.虽然不是因为这个确切的原因.

                Splitting the code into multiple classes is already in schedule. Although it wasn't for this exact reason.

                我知道常量池的限制,我的疑问正是其中的内容.生成的代码没有超过 10000 个方法+字段.

                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.

                我怀疑文字是否也进入常量池,因为这是我看到将此数字提高到 65K 的唯一原因.好像是这样.

                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.

                推荐答案

                http://en.wikipedia.org/wiki/Java_class_file#The_constant_pool

                常量池包括数字、字符串、方法名、字段名、类名、对类和方法的引用……基本上一切.

                The constant pool includes numbers, strings, method names, field names, class names, references to classes and methods...basically everything.

                最多可以有 65536 个.

                There can be at most 65536 of them.

                这篇关于Java“常量太多"JVM 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Bytecode features not available in the Java language(Java 语言中不可用的字节码功能)
                ClassCastException because of classloaders?(ClassCastException 因为类加载器?)
                How can I add a Javaagent to a JVM without stopping the JVM?(如何在不停止 JVM 的情况下将 Javaagent 添加到 JVM?)
                Cannot load 64-bit SWT libraries on 32-bit JVM ( replacing SWT file )(无法在 32 位 JVM 上加载 64 位 SWT 库(替换 SWT 文件))
                Encourage the JVM to GC rather than grow the heap?(鼓励 JVM 进行 GC 而不是增加堆?)
                Why a sawtooth shaped graph?(为什么是锯齿形图形?)
                      <bdo id='kFH6a'></bdo><ul id='kFH6a'></ul>
                          <tbody id='kFH6a'></tbody>

                        <small id='kFH6a'></small><noframes id='kFH6a'>

                        <i id='kFH6a'><tr id='kFH6a'><dt id='kFH6a'><q id='kFH6a'><span id='kFH6a'><b id='kFH6a'><form id='kFH6a'><ins id='kFH6a'></ins><ul id='kFH6a'></ul><sub id='kFH6a'></sub></form><legend id='kFH6a'></legend><bdo id='kFH6a'><pre id='kFH6a'><center id='kFH6a'></center></pre></bdo></b><th id='kFH6a'></th></span></q></dt></tr></i><div id='kFH6a'><tfoot id='kFH6a'></tfoot><dl id='kFH6a'><fieldset id='kFH6a'></fieldset></dl></div>

                        <legend id='kFH6a'><style id='kFH6a'><dir id='kFH6a'><q id='kFH6a'></q></dir></style></legend>
                        1. <tfoot id='kFH6a'></tfoot>