Giter Site home page Giter Site logo

chenghanpeng / jdk8u60 Goto Github PK

View Code? Open in Web Editor NEW
54.0 3.0 44.0 365.99 MB

《JVM G1源码分析和调优》一书参考的代码

License: GNU General Public License v2.0

Makefile 0.27% HTML 0.64% Shell 0.93% M4 0.08% C 6.65% Java 76.62% Batchfile 0.02% Objective-C 0.44% C++ 11.62% JavaScript 1.28% DTrace 0.05% Assembly 0.04% XSLT 0.06% Lex 0.01% Roff 1.26% Python 0.05% Perl 0.01% Ruby 0.01% Haskell 0.01% CSS 0.01%

jdk8u60's Introduction

README:
  This file should be located at the top of the OpenJDK Mercurial root
  repository. A full OpenJDK repository set (forest) should also include
  the following 6 nested repositories:
    "jdk", "hotspot", "langtools", "corba", "jaxws"  and "jaxp".

  The root repository can be obtained with something like:
    hg clone http://hg.openjdk.java.net/jdk8/jdk8 openjdk8
  
  You can run the get_source.sh script located in the root repository to get
  the other needed repositories:
    cd openjdk8 && sh ./get_source.sh

  People unfamiliar with Mercurial should read the first few chapters of
  the Mercurial book: http://hgbook.red-bean.com/read/

  See http://openjdk.java.net/ for more information about OpenJDK.

Simple Build Instructions:
  
  0. Get the necessary system software/packages installed on your system, see
     http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html

  1. If you don't have a jdk7u7 or newer jdk, download and install it from
     http://java.sun.com/javase/downloads/index.jsp
     Add the /bin directory of this installation to your PATH environment
     variable.

  2. Configure the build:
       bash ./configure
  
  3. Build the OpenJDK:
       make all
     The resulting JDK image should be found in build/*/images/j2sdk-image

where make is GNU make 3.81 or newer, /usr/bin/make on Linux usually
is 3.81 or newer. Note that on Solaris, GNU make is called "gmake".

Complete details are available in the file:
     http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html

jdk8u60's People

Contributors

chenghanpeng avatar quantumbear avatar

Stargazers

rammel avatar Lei Zhang 张磊 avatar  avatar knqiufan avatar  avatar JimWU avatar  avatar Wen Zhao (Joan) avatar Bingai avatar Aaron avatar Li Yanfeng avatar  avatar WANKAI avatar  avatar  avatar Saar avatar Jingzhou Zhao avatar Ballzu_Jane avatar  avatar bigjoe avatar  avatar  avatar  avatar  avatar Ben avatar Lehua Ding avatar harvey avatar 唯我纵横 avatar 所来人 avatar cz avatar hangtoo avatar  avatar  avatar turning_me avatar  avatar  avatar  avatar exiuqa avatar TheWings avatar cuihairu avatar  avatar programmer avatar ZhangCheng avatar fudali avatar  avatar  avatar GiraffeTree avatar 马超 avatar lineng avatar  avatar kzl avatar Frank Woo(吴峻申) avatar 三笠 avatar David Wong avatar

Watchers

Frank Woo(吴峻申) avatar 三笠 avatar Niall avatar

jdk8u60's Issues

堆内存为什么有慢速分配

我的理解是:因为tlab在E区有固定的占比,默认1%,那么当无法分配新的tlab时,会进入慢速分配,也就是直接在堆上分配。
那为什么不能调高tlab在E区的占比呢?尽可能的使用快速分配,避免慢速分配呢?这样设计可以么

CardTable 与 RSet 的区别

看了书之后我感觉我还是比较难理解 卡表与记忆集之前的区别,按照我现在的理解,貌似他们都是为了方便不同记录不同分区之间的一些引用关系而存在的;

感觉他们都是在干着相同的事情,只是卡表记录着全部分块应用,Rset 只记录部分跨分区之间(老->新;老->老)的引用?

@chenghanpeng

关于TLAB对象分配流程图的问题

作者您好,我在学习第3章 G1的对象分配 的 3.1小节时,有一点疑惑,在本书第45页的对象分配流程图中,关于TLAB剩余对象这部分,我的理解是TLAB剩余空间多的时候,继续分配新的TLAB,当剩余空间不足时,进行大对象的判断。不知道是不是笔误,如果您有时间的话,希望您能指导一下。十分感谢。

对第49页,小标题:1.如何判断TLAB满了有点疑惑。

1,书中写到,当请求对象大于refill_waste时会选择在堆中分配,请问这个堆具体是指的什么,是TLAB吗?
2,当一个1MB的TLAB使用16K,还剩1008K时,为什么内存是直接分配一个新的TLAB,那这1008K的空间岂不是浪费了。个人觉得是否应该是如果新的对象小于refill_waste则继续使用TLAB,否则分配一个新的?

4.2.1 请教Refinement采样线程采样不足的问题

在第四章,4.2.1 书中介绍抽样线程时提到 G1ConcRefinementServiceIntervalMillis 可以控制采样的间隔时间

如果生产中发现采样不足可以减少该时间

这里想请教

  1. 如何判断Refinement抽样不足?
  2. 抽样不足对GC的影响怎么来进行评估?

缘由也是工作中遇到GC Predicted Pause Time会无故变高,Young Generation同时无故变少很多导致GC频繁,苦于没有好的方案
源码中发现Predicted Pause Time与rs_length相关,可以是没有相应日志可以判断变化的原因。

感谢作者的大作,受益许多

5.3.5 Redirty章节内存复制后的处理

你好大佬, 非常开心能找到这本书解决了我的很多疑惑, 但是在阅读的过程中我还是有一些不太理解的地方, 可以帮忙解答一下吗? 非常感谢!

书中描述的步骤如下:

  1. 原引用: Obj5_OHR1.Field1 = Obj2_YHR2
  2. Obj2_YHR2 内存复制到 Obj2_YHR3
  3. Obj5_OHR1.Field1 = Obj2_YHR3

我本身的知识认知:

  1. 每个Java对象对应一个C++对象, 该C++对象内存储MarkWord、Klass引用地址、对象实例数据
  2. C++需要申请内存是返回一个句柄(通过Unsafe#allocateMemory方法推断出来的)

疑问点:
GC的时候Obj2由YHR2移动到YHR3, 那么Obj5_OHR1.Field1的引用地址会被修改吗?

  1. 如果被修改, 那么JVM是如何通过Java对象地址找到实际内存的位置
  2. 如果没有修改, JVM是否维护着一个Map, key是java对象地址, value是C++对象的句柄

《JVM G1源码分析与调优》 书中的异常

《JVM G1源码分析与调优》 P86页,G1ConcRefinementThresholdStep 计算公式错误 , 根据源码,应该是 _thread_threshold_step = (yellow_zone() - green_zone()) / (worker_thread_num() + 1); (少了个括号)

另 P143页下方“6.并发标记的正确性分析” 里面有一句话: “实际上存在Java根直接引用老生代对象,而不存在新生代对象到老生代的引用” 这句话是错误的吧,还是我理解有问题

望解答

4.6 关于 G1RSetUpdatingPauseTimePercent 描述为GC完成时间的百分比(默认为10%)

第4章, 4.6 介绍G1RSetUpdatingPauseTimePercent的原理时,提到"RSet所用的全部时间不超过GC完成时间的10%“
Oracle的文档有如下描述,大意是指G1RSetUpdatingPauseTimePercent 的分母为MaxGCPauseMillis而不是GC具体完成的时间

G1 tries to schedule concurrent processing of the remembered set updates so that the Update RS phase takes approximately -XX:G1RSetUpdatingPauseTimePercent percent of the allowed maximum pause time. By decreasing this value, G1 usually performs more remembered set update work concurrently.

源码里面用了max_gc_time() 去乘这个G1RSetUpdatingPauseTimePercent,看起来符合上面文档的描述

double update_rs_time_goal_ms = _mmu_tracker->max_gc_time() * MILLIUNITS * G1RSetUpdatingPauseTimePercent / 100.0;

所以想跟作者确认下这个细节的描述是否有不准确的地方 @chenghanpeng

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.