When running some operations, customers using 1 GB instances may see the following error:
"The allocation of an extra 12.0 MiB would use more than the limit 100.0 MiB. Currently using 92.0 MiB. dbms.memory.transaction.global_max_size threshold reached"
A 1 GB instance represents all the resources needed to run, which means the operating system, Java HEAP space, and the page cache are consuming their portion of the instance's resources. The graphic below shows how memory is portioned out. It is not possible to configure the specifics of how your memory is allocated as you can using the on-premises Enterprise Edition (e.g. you can't adjust the size of your HEAP).
- OS memory is what is available after accounting for neo4j.
- The JVM has a heap that is the runtime data area from which memory for all class instances and arrays is allocated.
- Native memory, sometimes referred to as off-heap memory, is memory directly allocated by Neo4j from the OS.
The database management system, or DBMS, contains the global components of the Neo4j instance. For example, the bolt server, logging service, monitoring service, etc.
- The page cache is used to cache the Neo4j data stored on disk. The caching of graph data and indexes into memory helps avoid costly disk access and results in optimal performance.
- Direct buffers are used by Neo4j to send and receive data.
- Lastly, the JVM itself comes with its own overhead.
You can find the total, used and free transaction memory for your Aura instance, on the whole, using the following query:
CALL dbms.listPools() YIELD pool, databaseName, heapMemoryUsed, freeMemory, totalPoolMemory
WHERE pool = "Transaction" AND databaseName = ""
RETURN pool, totalPoolMemory, heapMemoryUsed, freeMemory
Memory utilized by individual transactions can be checked using the below query:
Refer Neo4j Aura Troubleshoot (and Kill) Long Running Transactions / Queries
SHOW TRANSACTIONS YIELD database, transactionId, currentQueryId,
metaData, startTime, status, currentQueryStatus, currentQueryAllocatedBytes,
Regardless of the size of your instance, some portion of it will be taken up with overhead, but the transaction limit scales as the size of your instance grows (e.g. a 4 GB instance has a higher maximum transaction size than a 1 GB instance).
Additional Note on Heap Usage:
By nature, Heap Memory doesn't get cleared immediately after utilization.
The underlying JVM's Garbage collector kicks and clears Heap Memory only when it's almost full.
Hence the Heap utilization remains high even after the query completes execution, and this is normal.