# How does memory allocation work while running reflections on dremio

**URL:** <https://community.dremio.com/t/how-does-memory-allocation-work-while-running-reflections-on-dremio/11222>\
**Category:** Uncategorized\
**Created:** [November 30, 2023, 10:05am UTC](https://community.dremio.com/t/how-does-memory-allocation-work-while-running-reflections-on-dremio/11222 "2023-11-30T10:05:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanchitsk](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@sanchitsk](https://community.dremio.com/u/sanchitsk)\
**Post date:** [November 30, 2023, 10:05am UTC](https://community.dremio.com/t/how-does-memory-allocation-work-while-running-reflections-on-dremio/11222/1 "2023-11-30T10:05:08Z")

</div>

I am trying to create a reflection on a table that has almost 52GB in size. My dremio cluster has 8 executors each having 6 cores and 30gb memory. I am getting the error

```auto
Query was cancelled because it exceeded the memory limits set by the administrator.

```

I tried increasing the executor count to 12 and still getting the same issue. I even tried increasing heap memory by providing the following in my dremio-env file

```auto
DREMIO_MAX_HEAP_MEMORY_SIZE_MB=20480

```

Even giving 20GB as heap memory gives me the same error. How can i make sure my reflection runs? How does dremio use heap memory and direct memory for query execution and reflection runs?

---

<div class="post-metadata">

**Author:** ![bogdan.coman](https://avatars.discourse-cdn.com/v4/letter/b/f6c823/32.png) [@bogdan.coman](https://community.dremio.com/u/bogdan.coman)\
**Post date:** [December 1, 2023, 3:09am UTC](https://community.dremio.com/t/how-does-memory-allocation-work-while-running-reflections-on-dremio/11222/2 "2023-12-01T03:09:29Z")

</div>

Hi @sanchitsk,

You probably run out of direct memory, not heap. What’s the size of the direct memory on the executors?

Can you attach the reflection profile to the ticket, along with dremio.conf and the output of `ps -ef | grep dremio`?

Thanks, Bogdan
