6. Windows LFH
Windows Internals์ LFH์ ๋ํ ์ค๋ช - ๋ฉํฐ ์ค๋ ๋์์ ์ ๋์ํ๋ ์ด์ ?
... The LFH addresses these issues(* fragmentation) by using the core heap manager and look-aside
lists. The Windows heap manager implements an automatic tuning algorithm that can enable the LFH
by default under certain conditions, such as lock contention or the presence of popular size allocations
that have shown better performance with the LFH enabled. For large heaps, a significant percentage of
allocations is frequently grouped in a relatively small number of buckets of certain sizes. The allocation
strategy used by LFH is to optimize the usage for these patterns by efficiently handling same-size blocks.
To address scalability, the LFH expands the frequently accessed internal structures to a number of
slots that is two times larger than the current number of processors on the machine. The assignment
of threads to these slots is done by an LFH component called the affinity manager. Initially, the LFH
starts using the first slot for heap allocations; however, if a contention is detected when accessing some
internal data, the LFH switches the current thread to use a different slot. Further contentions will spread
threads on more slots. These slots are controlled for each size bucket to improve locality and minimize
the overall memory consumption. ...
๋ผ๊ณ ์ค๋ช ํ๊ณ ์์ผ๋ ์์งํ ๋ฌด์จ ์๋ฆฌ์ธ์ง ์ ํํ ์ดํด๋ฅผ ๋ชปํ๊ฒ ๋ค. ์์ฃผ ์ ๊ทผ๋๋ ๋ด๋ถ ๊ตฌ์กฐ์ฒด์
๋ํด ํด๋น ์ฌ๋กฏ์ ๋ํ ์ค๋ ๋์ ๋์ (assignment)์์ lock contention์ด ์ผ์ด๋๋ฉด ๋ค๋ฅธ
์ฌ๋กฏ์ ์ฐ๊ฒ ํด์ฃผ๋ฉฐ, ์ฌ๋กฏ๋ค์ ๊ฐ ์ฌ์ด์ฆ์ ๋ฒํท์ ์ํด ์ ์ด๋๋ค๊ณ ํ๋ค(์ง์ญ์ฑ๊ณผ ๋ฉ๋ชจ๋ฆฌ ์๋ชจ
์ต์ ํ๋ฅผ ์ํด). ๊ทผ๋ฐ ์ฌ๋กฏ์ด๋ ๋ด๋ถ ๊ตฌ์กฐ์ฒด, affinity manager๊ฐ ๋น์ต ์ ํํ ๋ญ์ง...