https://stackoverflow.com/questions/16130292/java-lang-outofmemoryerror-permgen-space-java-reflectio

Posted 规格严格-功夫到家-哈工大威海人

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了https://stackoverflow.com/questions/16130292/java-lang-outofmemoryerror-permgen-space-java-reflectio相关的知识,希望对你有一定的参考价值。

https://stackoverflow.com/questions/16130292/java-lang-outofmemoryerror-permgen-space-java-reflection

 

When using Java reflection, the JVM has two methods of accessing the information on the class being reflected. It can use a JNI accessor, or a Java bytecode accessor. If it uses a Java bytecode accessor, then it needs to have its own Java class and classloader (sun/reflect/GeneratedMethodAccessor class and sun/reflect/DelegatingClassLoader). Theses classes and classloaders use native memory. The accessor bytecode can also get JIT compiled, which will increase the native memory use even more. If Java reflection is used frequently, this can add up to a significant amount of native memory use. The JVM will use the JNI accessor first, then after some number of accesses on the same class, will change to use the Java bytecode accessor. This is called inflation, when the JVM changes from the JNI accessor to the bytecode accessor. Fortunately, we can control this with a Java property. The sun.reflect.inflationThreshold property tells the JVM what number of times to use the JNI accessor. If it is set to 0, then the JNI accessors are always used. Since the bytecode accessors use more native memory than the JNI ones, if we are seeing a lot of Java reflection, we will want to use the JNI accessors. To do this, we just need to set the inflationThreshold property to zero.

以上是关于https://stackoverflow.com/questions/16130292/java-lang-outofmemoryerror-permgen-space-java-reflectio的主要内容,如果未能解决你的问题,请参考以下文章

xml 在NestedScrollView中,RecycleView窃取焦点。 |||链接:https://stackoverflow.com/questions/36923948/recyclevi

ini 来自https://stackoverflow.com/questions/23704674/phpmyadmin-allow-remote-users

https://stackoverflow.com/questions/16130292/java-lang-outofmemoryerror-permgen-space-java-reflectio

ruby 来自https://stackoverflow.com/questions/2505067/class-self-idiom-in-ruby

powershell 来自https://stackoverflow.com/questions/1663748/powershell-analog-to-quote-words

text https://stackoverflow.com/questions/19752986/jquery-change-image-src-on-hover