0

I am using IoTDB on a machine with 32GB memory and set JVM max memory in iotdb_env.sh as following:

MAX_HEAP_SIZE = 25G

However, after two hours data ingestion, I found that IoTDB has used 31GB memory and will be killed by OOM killer soon. Why can IoTDB use more memory than MAX_HEAP_SIZE?

Ethan
  • 802
  • 6
  • 15
  • 27

1 Answers1

1

In jvm, memory is devided into heap memory and non-heap memory. You can refer to this question to get more detail information: What is the difference between Java Non Heap Memory and Stack Memory? Are they Same if not what is the difference between them? IoTDB uses some direct buffer which using non-heap memory. So total memory usage will exceed MAX_HEAP_SIZE. You can use following parameter in "iotdb_env.sh" to control non heap memory:

MAX_DIRECT_MEMORY_SIZE = 5G

You need to ensure MAX_HEAP_SIZE + MAX_DIRECT_MEMORY_SIZE < total memory to avoid OOM killer killing your IoTDB.

Zesong Sun
  • 185
  • 4