# False Sharing

DevFeed: [False Sharing](<https://devfeed.tech/articles/false-sharing-24842.md>)

Original publisher: [Read original article](<https://alidg.me/blog/2020/5/1/false-sharing>)

Author: Alimate

Published: 2020-05-01T00:00:00Z

Content type: article

Language: en

Sources: [Ali Dehghan - Kemikit](<https://devfeed.tech/sources/ali-dehghan-kemikit.md>)

Topics: [performance-engineering](<https://devfeed.tech/topics/performance-engineering.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [thread safe data sharing](<https://devfeed.tech/topics/thread-safe-data-sharing.md>)

Tags: [atomic](<https://devfeed.tech/tags/atomic.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [latency](<https://devfeed.tech/tags/latency.md>), [layout](<https://devfeed.tech/tags/layout.md>), [measuring](<https://devfeed.tech/tags/measuring.md>), [memory](<https://devfeed.tech/tags/memory.md>), [multithreading](<https://devfeed.tech/tags/multithreading.md>), [padding](<https://devfeed.tech/tags/padding.md>), [sharing](<https://devfeed.tech/tags/sharing.md>), [threads](<https://devfeed.tech/tags/threads.md>), [throughput](<https://devfeed.tech/tags/throughput.md>)

## AI overview

The excerpt benchmarks eight atomic counters incremented by eight threads, each targeting a distinct counter, and reports about 170 ns per call for the initial layout. Despite no logical counter contention, shared memory layout can affect performance: adding padding between counters produces surprising latency changes. The excerpt describes using JOL to inspect object layout and padding counters until each occupies a separate 64-byte area, but it ends before reporting the final benchmark result or explaining the full measurement.

## Source excerpt

Measuring false-sharing effect on latency and throughput