Memory limit exceeded
The memory limit exceeded error typically occurs when no memory limit has been set.
By: Manish Maheshwari, Data Architect and Data Scientist at Cloudera, Inc.
Error:
memory limit exceeded. Limit=2.00 GB Reservation=1.25 GB ReservationLimit=1.60 GB OtherMemory=775.70 MB Total=2.00 GB Peak=2.00 GB
Description and cause:
Typically this occurs because the memory limit is not set for the pool or table statistics are missing, or both.
Solution:
- Run
COMPUTE STATS
for each table involved in the query. -
Rerun the query with a memory limit set using the
SET MEM_LIMIT
query option. For example:SET MEM_LIMIT=3gb;
For more information, see COMPUTE STATS Statement and MEM_LIMIT Query Option.