垃圾收集未针对代码缓存内存池运行 [英] Garbage Collection not running for Code Cache Memory Pool

查看:212
本文介绍了垃圾收集未针对代码缓存内存池运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用GarbageCollectorMXBean打印垃圾收集的详细信息时,输出将显示以下信息:-

When I am printing the details of garbage collection using GarbageCollectorMXBean the output shows me the following information:-

Name: PS ScavengeCollection 
count: 72
Collection time: 3041
Memory Pools:   PS Eden Space   PS Survivor Space

Name: PS MarkSweepCollection 
count: 5
Collection time: 4922
Memory Pools:   PS Eden Space   PS Survivor Space   PS Old Gen 

现在非常正确地,ScavengeCollection和MarkSweep集合涵盖了5个可用内存池中的4个,但不包括

Now quite rightly the ScavengeCollection and MarkSweep collection covers 4 of the 5 available memory pool excluding

代码缓存(非堆内存).

Code Cache (Non Heap Memory).

我想知道为什么垃圾收集从来没有参加过

I want to know why the Garbage Collection never ran for

由CodeCacheManager内存池管理的代码缓存内存池.

Code Cache Memory Pool managed by CodeCacheManager Memory Pool.

是否暗示GC永远不会从CodeCacheManager内存池中垃圾收集对象?

Does it imply that GC never garbage collect objects from CodeCacheManager Memory Pool??

相同的意义吗?

推荐答案

阅读

Java虚拟机管理堆以外的内存(称为 作为非堆内存). Java虚拟机的方法区域 在所有线程之间共享.方法区域属于非堆 记忆.它存储每个类的结构,例如运行时常量 池,字段和方法数据,以及方法和代码 构造函数.它是在Java虚拟机启动时创建的.

The Java virtual machine manages memory other than the heap (referred as non-heap memory). The Java virtual machine has a method area that is shared among all threads. The method area belongs to non-heap memory. It stores per-class structures such as a runtime constant pool, field and method data, and the code for methods and constructors. It is created at the Java virtual machine start-up.

方法区域在逻辑上是堆的一部分,但是是Java虚拟的 机器实施可以选择不进行垃圾收集或 压缩它.与堆类似,方法区域可以是固定的 大小,或者可能会缩小.方法区域的内存 不需要是连续的.

The method area is logically part of the heap but a Java virtual machine implementation may choose not to either garbage collect or compact it. Similar to the heap, the method area may be of a fixed size or may be expanded and shrunk. The memory for the method area does not need to be contiguous.

除方法区域外,还有Java虚拟机实现 可能需要内存进行内部处理或优化,这也 属于非堆内存.例如,JIT编译器要求 用于存储从Java转换的本机代码的内存 虚拟机代码以实现高性能.

In addition to the method area, a Java virtual machine implementation may require memory for internal processing or optimization which also belongs to non-heap memory. For example, the JIT compiler requires memory for storing the native machine code translated from the Java virtual machine code for high performance.

您问非堆内存中有什么?

What falls into Non-Heap Memory you ask?

永久生成:该池包含虚拟机本身的所有反射数据,例如类和方法对象.对于使用类数据共享的Java VM,这一代被分为只读和读写区域.

Permanent Generation: The pool containing all the reflective data of the virtual machine itself, such as class and method objects. With Java VMs that use class data sharing, this generation is divided into read-only and read-write areas.

代码缓存:HotSpot Java VM还包括代码缓存,其中包含用于编译和存储本机代码的内存.

Code Cache: The HotSpot Java VM also includes a code cache, containing memory that is used for compilation and storage of native code.

这篇关于垃圾收集未针对代码缓存内存池运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆