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-reflection的更多相关文章

  1. Eclipse集成Tomcat报错:java.lang.OutOfMemoryError: PermGen space

    Eclipse集成Tomcat报错,使用Spring 4.3 框架,运行一段应用后,控制台报错: Unexpected death of background thread ContainerBack ...

  2. Eclipse+Maven环境下java.lang.OutOfMemoryError: PermGen space及其解决方法

    转自  https://blog.csdn.net/qdgengwenfei/article/details/71455432 java.lang.OutOfMemoryError: PermGen ...

  3. 在eclipse中启动项目报java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space

    在我们启动项目的时候经常会出现内存溢出这个错误  设置一下内存就ok 错误信息 java.util.concurrent.ExecutionException: java.lang.OutOfMemo ...

  4. Linux下启动tomcat报java.lang.OutOfMemoryError: PermGen space

    一.错误信息 java.lang.reflect.InvocationTargetException    at sun.reflect.NativeMethodAccessorImpl.invoke ...

  5. 出现 java.lang.OutOfMemoryError: PermGen space 错误的原因及解决方法

    一.原因及解决方法[1] 1.原因:堆内存的永久保存去区内存分配不足(缺省默认为64M),导致内存溢出错误. 2.解决方法:重新分配内存大小,-Xms1024M -Xmx2048M -XX:PermS ...

  6. Java内存问题:java.lang.OutOfMemoryError: PermGen space

    代码运行环境: jdk1.7.0_25 apache-tomcat-8.0.30 详细报错日志: org.springframework.web.util.NestedServletException ...

  7. Eclipse中启动tomcat报错java.lang.OutOfMemoryError: PermGen space的解决方法

    有的项目引用了太多的jar包,或者反射生成了太多的类,异或有太多的常量池,就有可能会报java.lang.OutOfMemoryError: PermGen space的错误, 我们知道可以通过jvm ...

  8. java.lang.OutOfMemoryError: PermGen space及其解决方法

    PermGen space的全称是Permanent Generation space,是指内存的永久保存区域OutOfMemoryError: PermGen space从表面上看就是内存益出,解决 ...

  9. [转]Tomcat启动java.lang.OutOfMemoryError: PermGen space错误解决

    原文地址:http://outofmemory.cn/java/OutOfMemoryError/outofmemoryerror-permgen-space-in-tomcat-with-eclip ...

  10. 【转载】java项目中经常碰到的内存溢出问题: java.lang.OutOfMemoryError: PermGen space, 堆内存和非堆内存,写的很好,理解很方便

    Tomcat Xms Xmx PermSize MaxPermSize 区别 及 java.lang.OutOfMemoryError: PermGen space 解决 解决方案 在 catalin ...

随机推荐

  1. ACM-并查集之小希的迷宫——hdu1272

    ***************************************转载请注明出处:http://blog.csdn.net/lttree************************** ...

  2. Android应用开发进阶篇-场景文字识别

    因为研究生毕业项目须要完毕一个基于移动终端的场景文字识别系统.尽管离毕业尚早,但出于兴趣的缘故,近一段抽时间完毕了这样一套系统. 主要的架构例如以下: client:Android应用实现拍摄场景图片 ...

  3. zoj3822 Domination 概率dp --- 2014 ACM-ICPC Asia Mudanjiang Regional Contest

    一个n行m列的棋盘,每次能够放一个棋子.问要使得棋盘的每行每列都至少有一个棋子 须要的放棋子次数的期望. dp[i][j][k]表示用了k个棋子共能占据棋盘的i行j列的概率. 那么对于每一颗棋子,在现 ...

  4. 《游戏脚本的设计与开发》-(RPG部分)3.8 通过脚本来自由控制游戏(一)

    注意:本系列教程为长篇连载无底洞.半路杀进来的朋友,假设看不懂的话.请从第一章開始看起.文章文件夹请点击以下链接. http://blog.csdn.net/lufy_legend/article/d ...

  5. luogu1890 gcd区间

    题目大意:给定一行n个正整数a[1]..a[n].m次询问,每次询问给定一个区间[L,R],输出a[L]..a[R]的最大公因数. 因为gcd满足交换律和结合律,所以用线段树维护区间上的gcd值即可. ...

  6. Linux - vim的基本使用

    通过which指令来查看文件位置! [root@local ~]# which vim /usr/bin/vim [root@local ~]# which vi /usr/bin/vi [root@ ...

  7. I NEED A OFFER!(hdoj--1203--01背包)

    I NEED A OFFER! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  8. V8 引擎是如何工作的?

    V8 引擎是如何工作的? 本文翻译自:How the V8 engine works? ​ V8是谷歌德国开发中心构建的一个JavaScript引擎.它是由C++编写的开源项目,同时被客户端(谷歌浏览 ...

  9. 优动漫PAINT个人版和EX版本差异

    优动漫PAINT是一款功能强大的动漫绘图软件,适用于个人和专业团队创作,分为个人版和EX版,那么这两个版本有什么区别,应该如何去选择呢? 优动漫PAINT个人版即可满足基本的绘画创作需求,EX版在个人 ...

  10. PhotoZoom Pro 7 支持哪些图像格式?

    PhotoZoom是一款新颖的.技术上具有革命性的对数码图片无损放大的工具.为设计工作者提供了优良的解决方案,可快速渲染出完美的放大照片,呈现无与伦比的画质效果.将因其应用的广泛性,所以对图像文件的支 ...