common_options/memory.rs
1// Copyright 2023 Greptime Team
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use serde::{Deserialize, Serialize};
16
17#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
18#[serde(default)]
19pub struct MemoryOptions {
20 /// Whether to enable heap profiling activation.
21 /// When enabled, heap profiling will be activated if the `MALLOC_CONF` environment variable
22 /// is set to "prof:true,prof_active:false". The official image adds this env variable.
23 /// Default is true.
24 pub enable_heap_profiling: bool,
25}
26
27impl Default for MemoryOptions {
28 fn default() -> Self {
29 Self {
30 enable_heap_profiling: true,
31 }
32 }
33}