Successfully reported this slideshow.
Your SlideShare is downloading. ×

More Related Content

Java 与 CPU 高速缓存

  1. 1. Java CPU 2016.07.20
  2. 2. • • • • •
  3. 3. • • Direct Mapping • N-way Mapping • • LRU • RND • • write through • write back • CPU cache line • •
  4. 4. Mac Cache • sudo sysctl -a | grep cache
  5. 5. Cache Coherence • MESI https://en.wikipedia.org/wiki/MESI_protocol • write back • • Cache line: dirty valid • Modified Cache • Exclusive Cache • Shared Cache • Invalid
  6. 6. MESI RFO: Request For Owner
  7. 7. MESI • http://blog.csdn.net/muxiqingyang/article/details/6615199
  8. 8. Java • • L1CacheMiss.java • duration = 701358693 • duration = 10996917277
  9. 9. Java • False Sharing
  10. 10. False sharing • Java 8: • @sun.misc.Contended • -XX:-RestrictContended • FalseSharing.java • duration = 27174444875 • duration = 3928016195 • duration = 3926949331
  11. 11. • https://en.wikipedia.org/wiki/CPU_cache • http://blog.csdn.net/robertsong2004/article/details/38340247 • https://en.wikipedia.org/wiki/MESI_protocol • http://blog.csdn.net/realxie/article/details/7317630 • http://mechanical-sympathy.blogspot.jp/2011/07/false-sharing.html • http://coderplay.iteye.com/blog/1485760 • http://coderplay.iteye.com/blog/1486649 • http://psy-lob-saw.blogspot.jp/2013/05/know-thy-java-object-memory- layout.html

×