`

Java垃圾回收——内存结构

    博客分类:
  • JVM
阅读更多

一般处理过程:

minor collections
 occurring at intervals long enough to allow many of the objects to die between collections.

It is well-tuned in the sense that the young generation is large enough (and thus the period between minor collections long enough) that the minor collection can take advantage of the high infant mortality rate.

This situation can be upset by applications with unusual lifetime distributions, or by poorly sized generations that cause collections to occur before objects have had time to die.

内存结构:
The default arrangement of generations (for all collectors with the exception of the throughput collector) looks something like this.

jvm-ram结构Java垃圾回收鈥斺斈诖娼峁
At initialization, a maximum address space is virtually reserved but not allocated to physical memory unless it is needed. The complete address space reserved for object memory can be divided into the young and tenured generations.

The young generation consists of eden plus two survivor spaces
Objects are initially allocated in eden.
One survivor space is empty at any time, and serves as a destination of the next, copying collection of any live objects in eden and the other survivor space.
Objects are copied between survivor spaces in this way until they are old enough to be tenured, or copied to the tenured generation.

A third generation closely related to the tenured generation is the permanent generation. Thepermanent generation is special because it holds data needed by the virtual machine to describe objects that do not have an equivalence at the Java language level. For example objects describing classes and methods are stored in the permanent generation.

智能处理,可选方案:


如果不行,个性化定制:

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics