# Out of memory exception

**URL:** <https://community.dremio.com/t/out-of-memory-exception/5970>\
**Category:** Uncategorized\
**Created:** [July 23, 2020, 1:01pm UTC](https://community.dremio.com/t/out-of-memory-exception/5970 "2020-07-23T13:01:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![reshma.cs](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@reshma.cs](https://community.dremio.com/u/reshma.cs)\
**Post date:** [July 23, 2020, 1:01pm UTC](https://community.dremio.com/t/out-of-memory-exception/5970/1 "2020-07-23T13:01:20Z")

</div>

May i know what is the best practice to allocate direct memory space, max total memory and heap memory.  
We had configured Dremio from the azure market place. We are currently using a medium cluster with 1 coordinator node and 10 executors. But we have been getting “out of memory” errors. But .  
The executors are Azure VMs of Standard\_E16s\_v3 (128 GB RAM). But somehow dremio keeps running out of memory. We had tried setting close to 116046 GB as DREMIO\_MAX\_MEMORY\_SIZE\_MB. But it keeps throwing the error that “Query exceeded memory limits set by admin”.  
May I know what are we doing wrong here.

---

<div class="post-metadata">

**Author:** ![Venugopal\_Menda](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/venugopal_menda/32/1457_2.png) [@Venugopal\_Menda](https://community.dremio.com/u/Venugopal_Menda)\
**Post date:** [July 23, 2020, 1:15pm UTC](https://community.dremio.com/t/out-of-memory-exception/5970/2 "2020-07-23T13:15:39Z")

</div>

@reshma.cs

Can you paste ps -ef | grep dremio ourput from dremio coordiantor and executor nodes ?

Also if you can share the query profile helps to look at the problem.

@Venugopal_Menda

---

<div class="post-metadata">

**Author:** ![reshma.cs](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@reshma.cs](https://community.dremio.com/u/reshma.cs)\
**Post date:** [July 23, 2020, 1:52pm UTC](https://community.dremio.com/t/out-of-memory-exception/5970/3 "2020-07-23T13:52:10Z")

</div>

Thanks Venugopal. Below is the executor and master configuration

Executor:

x86\_64/jre/bin/java -Djava.util.logging.config.class=org.slf4j.bridge.SLF4JBridgeHandler -Djava.library.path=/opt/dremio/lib -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/var/log/dremio/server.gc -Ddremio.log.path=/var/log/dremio -Ddremio.plugins.path=/opt/dremio/plugins -Xmx10000m -XX:MaxDirectMemorySize=100000m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/dremio -Dio.netty.maxDirectMemory=0 -DMAPR\_IMPALA\_RA\_THROTTLE -DMAPR\_MAX\_RA\_STREAMS=400 -cp /etc/dremio:/opt/dremio/jars/_:/opt/dremio/jars/ext/_:/opt/dremio/jars/3rdparty/\* com.dremio.dac.daemon.DremioDaemon  
DremioA+ 2970 2587 0 13:41 pts/0 00:00:00 grep --color=auto dremio

Master:

-Djava.util.logging.config.class=org.slf4j.bridge.SLF4JBridgeHandler -Djava.library.path=/opt/dremio/lib -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/var/log/dremio/server.gc -Ddremio.log.path=/var/log/dremio -Ddremio.plugins.path=/opt/dremio/plugins -Xmx8192m -XX:MaxDirectMemorySize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log dremio -Dio.netty.maxDirectMemory=0 -DMAPR\_IMPALA\_RA\_THROTTLE -DMAPR\_MAX\_RA\_STREAMS=400 -cp /etc/dremio:/opt/dremio/jars/_:/opt/dremio/jars/ext/_:/opt/dremio/jars/3rdparty/\* com.dremio.dac.daemon.DremioDaemon  
DremioA+ 67473 67398 0 13:50 pts/0 00:00:00 grep --color=auto dremio

---

<div class="post-metadata">

**Author:** ![Venugopal\_Menda](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/venugopal_menda/32/1457_2.png) [@Venugopal\_Menda](https://community.dremio.com/u/Venugopal_Menda)\
**Post date:** [July 23, 2020, 3:00pm UTC](https://community.dremio.com/t/out-of-memory-exception/5970/4 "2020-07-23T15:00:26Z")

</div>

@reshma.cs  
Can you provide the query profile as well for the failed query

@Venugopal_Menda

---

<div class="post-metadata">

**Author:** ![reshma.cs](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@reshma.cs](https://community.dremio.com/u/reshma.cs)\
**Post date:** [July 23, 2020, 3:03pm UTC](https://community.dremio.com/t/out-of-memory-exception/5970/5 "2020-07-23T15:03:51Z")

</div>

In the query profile I have been getting this as the error : Out of memory while receiving incoming message. Message size: 1048576

Allocation outcome details:  
allocator[op:1:0:incoming] reservation: 0 limit: 9223372036854775807 used: 18874368 requestedSize: 1048576 allocatedSize: 0 localAllocationStatus: success  
allocator[frag:1:0] reservation: 9000000 limit: 5368709120 used: 5351289344 requestedSize: 1048576 allocatedSize: 0 localAllocationStatus: success  
allocator[phase-1] reservation: 0 limit: 5368709120 used: 5351813632 requestedSize: 1048576 allocatedSize: 0 localAllocationStatus: success  
allocator[query-20e65b23-014a-da38-c4a7-d699f1db5c00] reservation: 0 limit: 5368709120 used: 5368590336 requestedSize: 1048576 allocatedSize: 0 localAllocationStatus: fail

---

<div class="post-metadata">

**Author:** ![mcotter](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@mcotter](https://community.dremio.com/u/mcotter)\
**Post date:** [July 23, 2020, 3:11pm UTC](https://community.dremio.com/t/out-of-memory-exception/5970/6 "2020-07-23T15:11:17Z")

</div>

I use VisualVM to monitor the java memory. Configure remote not local connections

---

<div class="post-metadata">

**Author:** ![mcotter](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@mcotter](https://community.dremio.com/u/mcotter)\
**Post date:** [July 23, 2020, 3:13pm UTC](https://community.dremio.com/t/out-of-memory-exception/5970/7 "2020-07-23T15:13:32Z")

</div>

JConsole is also good. It breaks down the java pools. I sent an email to our Oracle rep to see if we need to license JDK when using JConsole. VisaulVM is open source
