java 与 cpu 高速缓存

Post on 18-Feb-2017

3.298 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Java CPU 2016.07.20

• Direct Mapping

• N-way Mapping

• LRU

• RND

• write through

• write back

• CPU cache line

Mac Cache

• sudo sysctl -a | grep cache

Cache Coherence• MESI https://en.wikipedia.org/wiki/MESI_protocol

• write back

• Cache line: dirty valid

• Modified Cache

• Exclusive Cache

• Shared Cache

• Invalid

MESI

RFO: Request For Owner

MESI • http://blog.csdn.net/muxiqingyang/article/details/6615199

Java

• L1CacheMiss.java

• duration = 701358693

• duration = 10996917277

Java• False Sharing

False sharing

• Java 8:

• @sun.misc.Contended

• -XX:-RestrictContended

• FalseSharing.java

• duration = 27174444875

• duration = 3928016195

• duration = 3926949331

• 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

top related