Memory diagnosis
There are two memory diagnosis methods: regular memory diagnosis and shared memory diagnosis. Choose the appropriate method based on your needs.
Regular memory
You can check the polar_stat_activity_rt view as follows:
The polar_stat_activity_rt view requires the polar_monitor extension. This extension is installed by default with PolarDB for PostgreSQL (Compatible with Oracle). To enable the extension, run the create extension polar_monitor; command.
SELECT pid, rss
FROM polar_stat_activity_rt
ORDER BY rss
DESC; \watch 1You can then use polar_backends_mcxt to identify which memory context in the process consumes the most memory.
Detailed documentation for memory contexts in PolarDB for PostgreSQL (Compatible with Oracle) is not yet available. For now, perform further analysis using kernel code or SQL.
Shared memory
You can use polar_stat_shmem to view the shared memory distribution.