> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> jemalloc ヒーププロファイラによるサンプリングされた、生存中の割り当てごとに 1 行。テーブルを読み取ると、新しいヒーププロファイルがフラッシュされます。profiler が有効なスレッドのみが対象となります（`jemalloc_enable_profiler` 設定または `jemalloc_enable_global_profiler` config）。各行はおよそ `weight` 件の類似した割り当てを表します。

# system.jemalloc_sampled_allocations

## 説明

jemalloc ヒーププロファイラ によってサンプリングされた、生存中の割り当て 1 件につき 1 行を返します。このテーブルを読み取ると、新しい ヒーププロファイル がフラッシュされます。対象となるのは profiler が有効な スレッド のみです (`jemalloc_enable_profiler` 設定または `jemalloc_enable_global_profiler` config) 。各行は、おおよそ `weight` 件分の類似した割り当てを表します。

## カラム

* `trace` ([Array(UInt64)](/docs/ja/reference/data-types/array)) — 割り当てを行ったバックトレースのアドレス。leaf frame が先頭に並びます (`system.trace_log.trace` と同じ規約) 。`addressToSymbol` と `demangle` でシンボル化できます (`allow_introspection_functions` が必要です) 。
* `age_ns` ([UInt64](/docs/ja/reference/data-types/int-uint)) — プロファイルが flush された時点を基準とした、その割り当てが生存している時間 (ナノ秒) 。
* `size` ([UInt64](/docs/ja/reference/data-types/int-uint)) — 要求された割り当てサイズ (バイト単位) 。
* `usize` ([UInt64](/docs/ja/reference/data-types/int-uint)) — 利用可能なサイズ (バイト単位) 。すなわち、要求が切り上げられた先の size class のサイズです。
* `size_class` ([UInt16](/docs/ja/reference/data-types/int-uint)) — size class の索引。小さい size classes の場合は `system.jemalloc_bins.index` と結合できます。
* `arena` ([UInt32](/docs/ja/reference/data-types/int-uint)) — その割り当てが供給されたアリーナの索引。
* `thr_uid` ([UInt64](/docs/ja/reference/data-types/int-uint)) — 割り当てを行った スレッド の jemalloc 内部の一意な id。
* `sample_interval` ([UInt64](/docs/ja/reference/data-types/int-uint)) — サンプル間で割り当てられたバイト数の平均。プロファイルの header から取得され、すべての行で同じ値になります。

**別名:**

* `alloc_time` — `now() - intDiv(age_ns, 1000000000)` の別名。
* `weight` — `1 / (1 - exp((-usize) / sample_interval))` の別名。
