E.7. MON$MEMORY_USAGE
MON$MEMORY_USAGE
displays memory usage statistics.
Column Name | Data Type | Description |
---|---|---|
|
| Statistics identifier |
|
| Statistics group:
|
|
| The amount of memory in use, in bytes. This data is about the high-level memory allocation performed by the server. It can be useful to track down memory leaks and excessive memory usage in connections, procedures, etc. |
|
| The amount of memory allocated by the operating system, in bytes. This data is about the low-level memory allocation performed by the Firebird memory manager — the amount of memory allocated by the operating system — which can allow you to control the physical memory usage. |
|
| The maximum number of bytes used by this object |
|
| The maximum number of bytes allocated for this object by the operating system |
Counters associated with database-level records MON$DATABASE
(MON$STAT_GROUP = 0
), display memory allocation for all connections.
In Classic and SuperClassic, zero values of the counters indicate that these architectures have no common cache.
Minor memory allocations are not accrued here but are added to the database memory pool instead.
Getting 10 requests consuming the most memory
|
SELECT
| STMT.MON$ATTACHMENT_ID,
| STMT.MON$SQL_TEXT,
| MEM.MON$MEMORY_USED
|FROM MON$MEMORY_USAGE MEM
|NATURAL JOIN MON$STATEMENTS STMT
|ORDER BY MEM.MON$MEMORY_USED DESC
|FETCH FIRST 10 ROWS ONLY