title: How do I find the size of the L1 cache lines from within a Java process?
body: <p>I am interested in fine-tuning cache-conscious data structures (see for example the lock-free skip tree in <a href="http://mspiegel.github.io/publications/michael-spiegel-dissertation.pdf" rel="nofollow noreferrer">Michael Spiegel's dissertation</a> or Herlihy et al's <a href="http://mcg.cs.tau.ac.il/projects/hopscotch-hashing-1" rel="nofollow noreferrer">hopscotch hashing</a>) as well as in preventing <a href="http://en.wikipedia.org/wiki/False_sharing" rel="nofollow noreferrer">false sharing</a> e.g. during concurrent array processing.  I already know how to find the JVM pointer size via the "sun.arch.data.model" property, but I haven't been able to find a way to determine the size of cache lines in the L1 cache.</p>
  
  <p>Note that this information isn't critical, as I can just continue to use conservative estimates for the L1 line size (64 bytes when fine-tuning cache-conscious data structures, or 256 bytes when preventing false sharing); however if it's easy to acquire the L1 cache properties then I may as well make use of it.</p>