| Goal |
Command |
| Check current YSQL session memory summary |
SELECT pg_size_pretty(sum(total_bytes)) FROM pg_backend_memory_contexts; |
| Inspect largest session memory contexts |
SELECT ... FROM pg_backend_memory_contexts ORDER BY total_bytes DESC LIMIT 10; |
| Check YugabyteDB session memory usage |
SELECT yb_mem_usage_kb(); |
| Check YugabyteDB SQL-layer session memory usage |
SELECT yb_mem_usage_sql_kb(); |
| Find the current backend process ID |
SELECT pg_backend_pid(); |
| Check current backend process memory from Linux |
\! ps -o pid,user,rss,vsz,comm,args -p <pid> |
| Check host memory summary |
\! free -h |
| Check detailed Linux memory information |
\! cat /proc/meminfo |
| Check running YugabyteDB processes |
\! top -c -u yugabyte |