> ## 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.

# memory_profiler_* セッション設定

> memory_profiler_* 生成グループの ClickHouse セッション設定。

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>型</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>デフォルト値</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          再起動せずに変更可能
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

これらの設定は [system.settings](/docs/ja/reference/system-tables/settings) で確認でき、[ソースコード](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp) から自動生成されています。

<div id="memory_profiler_sample_max_allocation_size">
  ## memory\_profiler\_sample\_max\_allocation\_size
</div>

<SettingsInfoBlock type="UInt64" default_value="0" />

指定した値以下のサイズのランダムな割り当てを、`memory_profiler_sample_probability` と同じ確率で収集します。0 は無効を意味します。このしきい値を想定どおりに機能させるには、`max_untracked_memory` を 0 に設定するとよい場合があります。

<div id="memory_profiler_sample_min_allocation_size">
  ## memory\_profiler\_sample\_min\_allocation\_size
</div>

<SettingsInfoBlock type="UInt64" default_value="0" />

指定した値以上のサイズの割り当てを、`memory_profiler_sample_probability` と同じ確率でランダムに収集します。0 は無効を意味します。このしきい値が想定どおりに機能するよう、`max_untracked_memory` を 0 に設定したほうがよい場合があります。

<div id="memory_profiler_sample_probability">
  ## memory\_profiler\_sample\_probability
</div>

<SettingsInfoBlock type="Float" default_value="0" />

ランダムな割り当てと解放を収集し、trace\_type が 'MemorySample' のものとして system.trace\_log に書き込みます。この確率は、割り当てサイズに関係なく、各割り当て/解放操作に対して適用されます (`memory_profiler_sample_min_allocation_size` と `memory_profiler_sample_max_allocation_size` で変更できます) 。サンプリングは、未追跡メモリ量が 'max\_untracked\_memory' を超えた場合にのみ発生する点に注意してください。より細かくサンプリングしたい場合は、'max\_untracked\_memory' を 0 に設定するとよいでしょう。

<div id="memory_profiler_step">
  ## memory\_profiler\_step
</div>

<SettingsInfoBlock type="UInt64" default_value="4194304" />

メモリプロファイラの間隔を設定します。クエリのメモリ使用量が、バイト数で次の各間隔を超えるたびに、メモリプロファイラは割り当て時のスタックトレースを収集し、[trace\_log](/docs/ja/reference/system-tables/trace_log)に書き込みます。

設定可能な値:

* 正の整数のバイト数。

* メモリプロファイラを無効にする場合は 0。
