You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "MileaRobertStefan (via GitHub)" <gi...@apache.org> on 2026/05/25 10:46:25 UTC

[I] [Bug] [iotdb]

MileaRobertStefan opened a new issue, #17764:
URL: https://github.com/apache/iotdb/issues/17764

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/iotdb/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.
   
   <img width="1108" height="349" alt="Image" src="https://github.com/user-attachments/assets/d5f49116-56c7-4af6-b15e-57ccd5bfca0b" />
   
   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
   
   ```bash
   # 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?
   
   - [x] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

Posted by "MileaRobertStefan (via GitHub)" <gi...@apache.org>.
MileaRobertStefan commented on issue #17764:
URL: https://github.com/apache/iotdb/issues/17764#issuecomment-4534026436

   #17765


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org