For a temporary workaround, recommend to perform the following statements
ALTER SYSTEM CLEAR SQL PLAN CACHE;
ALTER SYSTEM CLEAR COLUMN RESULT CACHE;
Here are the steps to collect the itab traces: (*Please be aware the collection of traces will reduce the DB performance for while the traces are on)
(Need to capture the time when the itab allocator increases)
SELECT CURRENT_TIMESTAMP as ITAB_START_TIME from dummy;
ALTER SYSTEM ALTER CONFIGURATION ('indexserver.ini', 'SYSTEM') SET
('itab', 'trace_leaks') = 'yes',
('itab', 'trace_leakcallstack') = 'yes',
('itab', 'trace_addrefcallstack') = 'no',
('itab', 'leaktrace_max_callstacks') = '20000'
with reconfigure;
Important: Enabling this trace may have a performance impact, proceed with caution, avoid running this in production unless instructed by HANA Development Support.
ALTER SYSTEM CLEAR SQL PLAN CACHE;
This step is only necessary if the memory pressure is already high as clearing the sql plan cache can help reducing itab memory consumption.
CREATE COLUMN TABLE TEMPORARY_TABLES_BEFORE_MEM_GROWTH AS (SELECT * FROM M_TEMPORARY_TABLES);
SELECT * FROM
(SELECT TO_VARCHAR(CURRENT_TIMESTAMP) AS THETIME, HOST,PORT, CATEGORY,
ROUND((EXCLUSIVE_SIZE_IN_USE) / 1024 / 1024, 2) AS USED_MEMORY_SIZE_IN_MB
FROM M_HEAP_MEMORY
WHERE CATEGORY IN ('' )
ORDER BY HOST,PORT,USED_MEMORY_SIZE_IN_MB DESC)
UNION ALL
(SELECT THETIME, HOST, PORT, CATEGORY, MAX(USED_MEMORY_SIZE_IN_MB) AS USED_MEMORY_SIZE_IN_MB FROM
(SELECT TO_VARCHAR(SERVER_TIMESTAMP) AS THETIME, HOST, PORT, CATEGORY, ROUND((EXCLUSIVE_SIZE_IN_USE) / 1024 / 1024, 2) AS USED_MEMORY_SIZE_IN_MB FROM "_SYS_STATISTICS"."HOST_HEAP_ALLOCATORS"
WHERE CATEGORY IN ('' ))
GROUP BY HOST, PORT, CATEGORY, THETIME)
ORDER BY THETIME DESC;
CREATE COLUMN TABLE TEMPORARY_TABLES_AFTER_MEM_GROWTH AS (SELECT * FROM M_TEMPORARY_TABLES);
CREATE COLUMN TABLE ITAB_LEAKS_AFTER_MEM_GROWTH AS (SELECT * FROM SYS.M_DEV_ITAB_LEAK ORDER BY CREATION_TIME ASC);
ALTER SYSTEM CLEAR SQL PLAN CACHE;
ALTER SYSTEM CLEAR COLUMN RESULT CACHE;
CREATE COLUMN TABLE TEMPORARY_TABLES_AFTER_MEM_GROWTH_CACHE_CLEAR AS (SELECT * FROM M_TEMPORARY_TABLES);
CREATE COLUMN TABLE ITAB_LEAKS_AFTER_MEM_GROWTH_CACHE_CLEAR AS (SELECT * FROM SYS.M_DEV_ITAB_LEAK ORDER BY CREATION_TIME ASC);
ALTER SYSTEM ALTER CONFIGURATION ('indexserver.ini', 'SYSTEM') UNSET
('itab', 'trace_leaks'),
('itab', 'trace_leakcallstack'),
('itab', 'trace_addrefcallstack'),
('itab', 'leaktrace_max_callstacks')
with reconfigure;
CREATE COLUMN TABLE HOST_HEAP_ALLOCATORS_BASE_COPY AS
(SELECT * FROM _SYS_STATISTICS.HOST_HEAP_ALLOCATORS_BASE
WHERE server_timestamp between
<time where the itab_leak traces started from step 1 - ITAB_START_TIME>
and current_timestamp );
EXPORT
TEMPORARY_TABLES_BEFORE_MEM_GROWTH,
TEMPORARY_TABLES_AFTER_MEM_GROWTH,
ITAB_LEAKS_AFTER_MEM_GROWTH,
TEMPORARY_TABLES_AFTER_MEM_GROWTH_CACHE_CLEAR,
ITAB_LEAKS_AFTER_MEM_GROWTH_CACHE_CLEAR,
HOST_HEAP_ALLOCATORS_BASE_COPY AS BINARY INTO '/target/linux/folder' WITH THREADS 6;
Remarks: As it is costly to keep all call stacks for all itab leaks, parameter leaktrace_max_callstacks (set to 20000 on this document) should have a sufficiently large number in order to capture the callstack associated with the suspicious statements.