Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug] IotDB pods crash with OOM because we calculate the memory based on the node not pod resources

オープン
#17,764 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
java, shell
領域
databases, devops

調査の方向性

conf/confignode-env.sh と conf/datanode-env.sh から始め、特に free -m を使用した system_memory_in_mb の計算を確認します。issue に記載されている cgroup v2 と v1 のメモリ制限のケースを比較し、8 GB に制限された pod がホストのメモリではなくその制限値に基づいて JVM のサイズを決定し、OOM による再起動を回避することを確認します。

索引モデルが issue の本文から書いたものです。

説明

Search before asking
  • I searched in the issues and found nothing similar.
Version

latest

Describe the bug and provide the minimal reproduce step

Start IOTDB datanode and confignode pods with memory limits, for example 8 GB, and allocate 8 GB of resources to each pod.

Image

Pods keep crashing with OOM errors because the JVM is trying to allocate 16 GB of memory.

What did you expect to see?
            # When running in a container/pod, use cgroup memory limit instead of host memory
            if [ -f /sys/fs/cgroup/memory.max ]; then
                # cgroup v2
                cgroup_mem=`cat /sys/fs/cgroup/memory.max`
                if [ "$cgroup_mem" != "max" ]; then
                    cgroup_mem_in_mb=`expr $cgroup_mem / 1024 / 1024`
                    if [ "$cgroup_mem_in_mb" -lt "$system_memory_in_mb" ]; then
                        system_memory_in_mb=$cgroup_mem_in_mb
                    fi
                fi
            elif [ -f /sys/fs/cgroup/memory/memory.limit_in_bytes ]; then
                # cgroup v1
                cgroup_mem=`cat /sys/fs/cgroup/memory/memory.limit_in_bytes`
                cgroup_mem_in_mb=`expr $cgroup_mem / 1024 / 1024`
                if [ "$cgroup_mem_in_mb" -lt "$system_memory_in_mb" ]; then
                    system_memory_in_mb=$cgroup_mem_in_mb
                fi
            fi

8GB

I would expect the memory to be auto-calculated based on the pod resources (8 GB), not the node resources (32 GB).

# scripts\conf\datanode-env.sh
system_memory_in_mb=`free -m | sed -n '2p' | awk '{print \$2}'` returns 32 GB.
What did you see instead?

32 GB and a lot of pod restarts

Anything else?
# iotdb\WORKING_CONFIGS.md

## 2) JVM Memory (Linux)

Edit these files:
- conf/confignode-env.sh
- conf/datanode-env.sh

Set MEMORY_SIZE explicitly to avoid auto-sizing surprises.

### ConfigNode memory

```bash
# conf/confignode-env.sh
MEMORY_SIZE=2G
DataNode memory
# conf/datanode-env.sh
MEMORY_SIZE=8G

Why are there no env varibales for this setting?
Do you expect the clouad env to manualy go and change this limit?

This is a hack, and we should not have to do this in a pod

- IOTDB_JMX_OPTS=-Xmx4G
Are you willing to submit a PR?
  • I'm willing to submit a PR!
主要言語
Java
スター
6.4k
フォーク
1.2k
平均マージ
1日 17時間
マージ済み PR(30日)
152

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/iotdb のほかの issue

apache/iotdb の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。