diff --git a/pages/data-migration/best-practices.mdx b/pages/data-migration/best-practices.mdx index 0ae14c6b..735e0f10 100644 --- a/pages/data-migration/best-practices.mdx +++ b/pages/data-migration/best-practices.mdx @@ -540,6 +540,21 @@ of the `--storage-gc-cycle-sec` flag. That means that Memgraph's garbage collector potentially still didn't deallocate unused objects and free the memory. You can free up memory by running the `FREE MEMORY` query. +## Monitoring memory during import + +Often times, the user needs to batch transactions in the `IN_MEMORY_TRANSACTIONAL` storage mode. +This is due to large-update transactions that are creating a lot of `Delta` objects during the +transaction lifetime. `Delta` objects are necessary for reverting the query if an error during +query execution happens. They are approximately of 56 bytes in size, but large-update transactions +can make the number of delta objects be huge - therefore resulting in Memgraph getting out of memory. + +We have exposed the `peak_memory_res` (peak resident memory) variable in the `SHOW STORAGE INFO;` command. with which you +can monitor when the peak resident memory rises in the system. +It will help you diagnose bottlenecks and high-memory queries which can be optimized. +That is most common in import queries because users would want to import the whole dataset with one command only. + +For more information, check our [storage memory usage](/fundamentals/storage-memory-usage). + ## Do you have more questions? Schedule a 30 min session with one of our engineers to discuss how Memgraph fits diff --git a/pages/database-management/server-stats.md b/pages/database-management/server-stats.md index 50d445ae..cd11030c 100644 --- a/pages/database-management/server-stats.md +++ b/pages/database-management/server-stats.md @@ -29,13 +29,15 @@ The result will contain the following fields: | Field | Description | |------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| name | Name of the current database. | | vertex_count | The number of stored nodes (vertices). | | edge_count | The number of stored relationships (edges). | | average_degree | The average number of relationships of a single node. | +| vm_max_map_count | The number of memory-mapped areas that the kernel allows a process to have. If it is unknown, returns -1.
For more info, check out [virtual memory section of the docs](/fundamentals/storage-memory-usage#virtual-memory). | | memory_res | The non-swapped physical RAM memory a task has used, reported by the OS (in B, KiB, MiB, GiB or TiB). | +| peak_memory_res | Peak RAM memory usage in the system during the whole run. | | disk_usage | The amount of disk space used by the data directory (in B, KiB, MiB, GiB or TiB). | | memory_tracked | The amount of RAM allocated in the system and tracked by Memgraph (in B, KiB, MiB, GiB or TiB).
For more info, check out [memory control](/fundamentals/storage-memory-usage). | -| vm_max_map_count | The number of memory-mapped areas that the kernel allows a process to have. If it is unknown, returns -1.
For more info, check out [virtual memory section of the docs](/fundamentals/storage-memory-usage#virtual-memory). | | allocation_limit | The current allocation limit set for this instance (in B, KiB, MiB, GiB or TiB).
For more info, check out the [memory control](/fundamentals/storage-memory-usage#control-memory-usage). | | global_isolation_level | The current `global` isolation level.
For more info, check out [isolation levels](/fundamentals/transactions#isolation-levels). | | session_isolation_level | The current `session` isolation level. | diff --git a/pages/fundamentals/storage-memory-usage.mdx b/pages/fundamentals/storage-memory-usage.mdx index c417d3fc..8b00ea8a 100644 --- a/pages/fundamentals/storage-memory-usage.mdx +++ b/pages/fundamentals/storage-memory-usage.mdx @@ -729,13 +729,15 @@ SHOW STORAGE INFO; | storage info | value | +--------------------------------+--------------------------------+ | "name" | "memgraph" | -| "vertex_count" | 2677 | -| "edge_count" | 11967 | -| "average_degree" | 8.94061 | -| "memory_usage" | "44.32MiB" | -| "disk_usage" | "133.63KiB" | -| "memory_allocated" | "6.74MiB" | -| "allocation_limit" | "15.28GiB" | +| "vertex_count" | 0 | +| "edge_count" | 0 | +| "average_degree" | 0 | +| "vm_max_map_count" | 453125 | +| "memory_res" | "43.16MiB" | +| "peak_memory_res" | "43.16MiB" | +| "disk_usage" | "104.46KiB" | +| "memory_tracked" | "8.52MiB" | +| "allocation_limit" | "58.55GiB" | | "global_isolation_level" | "SNAPSHOT_ISOLATION" | | "session_isolation_level" | "" | | "next_session_isolation_level" | "" |