Skip to Content
Technical Articles
Author's profile photo Rajarajeswari Kaliyaperumal

How to find which user is consuming maximum memory in HANA

User with maximum memory consumption in HANA:

During performance issues, if we are able to narrow down the maximum memory consumption is with respect to Statement Execution rather than column store, below command will help us to detect which user is consuming maximum memory.

NOTE: This user can either be running 1 or more than 1 statements and hence this is just the SUM of memory consumed by the user’s statements as such .



with cte as (

select, c.user_name,c.connection_id, c.connection_status, c.transaction_id, s.last_executed_time,

round(s.allocated_memory_size/1024/1024/1024,2) as “Alloc Mem (GB)”,

round(s.used_memory_size/1024/1024/1024,2) as UMem_GB, s.statement_string


m_connections c, m_prepared_statements s


s.connection_id = c.connection_id and c.connection_status != ‘IDLE’

order by

s.allocated_memory_size desc)

select distinct USER_NAME,SUM(UMem_GB) from cte group by USER_NAME;



Sample output:


TIPS: To find out the HANA memory distribution , navigate to below path.

HANA studio-> System information -> type mem and double click as shown below.

In below statement execution is consuming more memory and hence it is useful to narrow down to user who is executing these statements and its consumption.

Thanks for reading!
Follow for more such posts!
Like and leave a comment or suggestion if any!

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Michael Layher
      Michael Layher

      Please ignore this. Does not run

      Author's profile photo Shehzad Ahmed
      Shehzad Ahmed

      Thanks for the blog, I tweak the query as per my need and it gives me the list of all users who consumed more memory as compared to other users

      Author's profile photo Moid Mohammed
      Moid Mohammed

      what was your tweak ...kindly!!

      Author's profile photo Srimayee Dash
      Srimayee Dash

      The query is giving syntax errors.


      Could you please let us know is there anyway to find what causing the index server memory utilization too high

      Author's profile photo Daniel basis
      Daniel basis

      I get the schema username instead of the Application user name.

      How to get the top memory-consuming application usernames.