- Newest
- Most votes
- Most comments
-
Yes, this is expected behavior. The database engine attempts to use available memory (FreeableMemory) first. When memory is insufficient, it spills over to disk (FreeLocalStorage). Once the query starts using disk, some memory is freed, causing FreeableMemory to increase again.
-
Correct, the query allocates memory dynamically during its execution. It may start with the available memory and then allocate more as needed. If it exceeds the available memory (work_mem), it starts using disk, which is why it doesn't fail immediately.
-
The 1944928kb indicates the amount of data that had to be written to disk (spilled over). The drop in FreeLocalStorage and the spike in temp_bytes are results of this disk usage. The discrepancy in exact values can be due to additional overhead or concurrent operations.
-
Partially, by analyzing the query plan and understanding the memory requirements of operations like sorting and joining. However, exact predictions can be challenging due to dynamic memory allocation and concurrent operations.
-
Analyze the EXPLAIN output to understand memory-intensive operations. Adjust work_mem and max_parallel_workers_per_gather accordingly. Ensure the total memory required (based on the query plan) is within the available FreeableMemory.
-
FreeableMemory is part of the total memory available (after the memory used by underline system process) as specified under the instance type specs.
Relevant content
- asked 6 months ago
- Accepted Answerasked 5 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 7 months ago