Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#17,764 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
java, shell
Lĩnh vực
databases, devops

Hướng nghiên cứu

Bắt đầu với conf/confignode-env.sh và conf/datanode-env.sh, đặc biệt là phép tính system_memory_in_mb sử dụng free -m. So sánh các trường hợp giới hạn bộ nhớ cgroup v2 và v1 được mô tả trong issue, sau đó xác minh rằng một pod bị giới hạn ở 8 GB sẽ định cỡ JVM dựa trên giới hạn đó thay vì bộ nhớ của host và tránh được việc khởi động lại do OOM.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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!
Ngôn ngữ chính
Java
Star
6.4k
Fork
1.2k
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
178

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/iotdb

Tất cả issue của apache/iotdb

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.