# How to set dremio max memory?

**URL:** <https://community.dremio.com/t/how-to-set-dremio-max-memory/2468>\
**Category:** Uncategorized\
**Created:** [December 25, 2018, 1:36am UTC](https://community.dremio.com/t/how-to-set-dremio-max-memory/2468 "2018-12-25T01:36:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjbhjsj](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bjbhjsj](https://community.dremio.com/u/bjbhjsj)\
**Post date:** [December 25, 2018, 1:36am UTC](https://community.dremio.com/t/how-to-set-dremio-max-memory/2468/1 "2018-12-25T01:36:39Z")

</div>

Hi,dremio friend:  
when I config the value for dremio in file /opt/dremio/conf/dremio-env like this:  
DREMIO\_LOG\_DIR=/var/log/dremio  
DREMIO\_PID\_DIR=/var/run/dremio  
DREMIO\_MAX\_HEAP\_MEMORY\_SIZE\_MB=8192  
DREMIO\_MAX\_MEMORY\_SIZE\_MB=16384  
#DREMIO\_MAX\_HEAP\_MEMORY\_SIZE\_MB=8192  
DREMIO\_MAX\_DIRECT\_MEMORY\_SIZE\_MB=16384

but the dremio start log like this

Dremio Daemon Started as master  
Tue Dec 25 09:25:11 CST 2018 Starting dremio on gpmaster  
core file size (blocks, -c) 0  
data seg size (kbytes, -d) unlimited  
scheduling priority (-e) 0  
file size (blocks, -f) unlimited  
pending signals (-i) 160637  
max locked memory (kbytes, -l) 64  
max memory size (kbytes, -m) unlimited  
open files (-n) 65536  
pipe size (512 bytes, -p) 8  
POSIX message queues (bytes, -q) 819200  
real-time priority (-r) 0  
stack size (kbytes, -s) 10240  
cpu time (seconds, -t) unlimited  
max user processes (-u) 131072  
virtual memory (kbytes, -v) unlimited  
file locks (-x) unlimited  
KVStore version is 3.0.0-201810262305460004-5c90d75  
max memory size (kbytes, -m) unlimited

this describe my dremio’s max memory size is unlimited

---

<div class="post-metadata">

**Author:** ![laurent](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/laurent/32/16_2.png) [@laurent](https://community.dremio.com/u/laurent)\
**Post date:** [December 25, 2018, 1:44am UTC](https://community.dremio.com/t/how-to-set-dremio-max-memory/2468/2 "2018-12-25T01:44:15Z")

</div>

These messages describes what kind of limits your operating systems (Linux) may set on the process, but the settings in `dremio-env` instructs the Java virtual machine how much memory to be used in practice.

---

<div class="post-metadata">

**Author:** ![bjbhjsj](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bjbhjsj](https://community.dremio.com/u/bjbhjsj)\
**Post date:** [December 25, 2018, 2:00am UTC](https://community.dremio.com/t/how-to-set-dremio-max-memory/2468/3 "2018-12-25T02:00:39Z")

</div>

Hi, Mr. laurent . thank your reply my problem . how to set the dremio max memory ?

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [December 25, 2018, 7:26am UTC](https://community.dremio.com/t/how-to-set-dremio-max-memory/2468/4 "2018-12-25T07:26:45Z")

</div>

Hi @bjbhjsj

In /opt/dremio/conf/dremio-env,

Either set DREMIO\_MAX\_MEMORY\_SIZE\_MB=16384  
(OR)  
DREMIO\_MAX\_HEAP\_MEMORY\_SIZE\_MB=8192  
DREMIO\_MAX\_DIRECT\_MEMORY\_SIZE\_MB=16384

When you give DREMIO\_MAX\_MEMORY\_SIZE\_MB, the Heap gets 4GB and the rest for direct. On the coordinator you do not require much of direct memory while on the executor you can keep the heap at the minimum 4GB

If you are running a single node Dremio then just set DREMIO\_MAX\_MEMORY\_SIZE\_MB. Do not go very close to the OS memory as the OS needs some for itself.

Thanks  
@balaji.ramaswamy

---

<div class="post-metadata">

**Author:** ![bjbhjsj](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bjbhjsj](https://community.dremio.com/u/bjbhjsj)\
**Post date:** [December 25, 2018, 7:36am UTC](https://community.dremio.com/t/how-to-set-dremio-max-memory/2468/5 "2018-12-25T07:36:37Z")

</div>

thanks @balaji.ramaswamy  
I had one physical machine(256G memory) which Four virtual machine every for 40G OS memory, I give every dremio for 16384M, run reflection query from single table ( 670,000,000 records) base on greenplum(postgresql cluster)
