diff --git a/pages/fundamentals/storage-memory-usage.mdx b/pages/fundamentals/storage-memory-usage.mdx index da11d7d97..0aa029782 100644 --- a/pages/fundamentals/storage-memory-usage.mdx +++ b/pages/fundamentals/storage-memory-usage.mdx @@ -445,7 +445,7 @@ accurately. If you want to **estimate** memory usage in `IN_MEMORY_TRANSACTIONAL` storage mode, use the following formula: -$\texttt{StorageRAMUsage} = \texttt{NumberOfVertices} \times 212\text{B} + \texttt{NumberOfEdges} \times 162\text{B}$ +$\texttt{StorageRAMUsage} = \texttt{NumberOfVertices} \times 204\text{B} + \texttt{NumberOfEdges} \times 154\text{B}$ @@ -463,7 +463,7 @@ According to the formula, storage memory usage should be: $ \begin{aligned} -\texttt{StorageRAMUsage} &= 21,723 \times 260\text{B} + 682,943 \times 180\text{B} \\ &= 5,647,980\text{B} + 122,929,740\text{B}\\ &= 128,577,720\text{B} \approx 125\text{MB} +\texttt{StorageRAMUsage} &= 21,723 \times 252\text{B} + 682,943 \times 172\text{B} \\ &= 5,474,196\text{B} + 117,466,196\text{B}\\ &= 122,940,392\text{B} \approx 117\text{MB} \end{aligned} $ @@ -498,14 +498,16 @@ But, if the database has a lot of concurrent operations, many `Delta` objects will be created. Of course, the `Delta` objects will be kept in memory as long as needed, and a bit more, because of the internal GC inefficiencies. +todo + {

Delta memory layout

} Each `Delta` object has a least **56B**. {

Vertex memory layout

} -Each `Vertex` object has at least **88B** + **56B** for the `Delta` object, in -total, a minimum of **144B**. +Each `Vertex` object has at least **80B** + **56B** for the `Delta` object, in +total, a minimum of **136B**. Each additional label takes **4B**. @@ -515,8 +517,8 @@ memory allocation. {

Edge memory layout

} -Each `Edge` object has at least **40B** + **56B** for the `Delta` object, in -total, a minimum of **96B**. +Each `Edge` object has at least **32B** + **56B** for the `Delta` object, in +total, a minimum of **88B**. {

SkipList memory layout

} @@ -610,7 +612,7 @@ Let's assume the name on average has $3\text{B}+10\text{B} = 13\text{B}$ (each name is on average 10 characters long). One the average values are included, the calculation is: -$19,148 \times (88\text{B} + 13\text{B} + 16\text{B} + 16\text{B} + 56\text{B}) = 19,148 \times 189\text{B} = 3,618,972\text{B}.$ +$19,148 \times (80\text{B} + 13\text{B} + 16\text{B} + 16\text{B} + 56\text{B}) = 19,148 \times 181\text{B} = 3,465,788\text{B}.$ The remaining 2,584 vertices are the `ComicSeries` vertices with the `title` and `publishYear` properties. Let's assume that the `title` property is @@ -622,9 +624,9 @@ list occupies $3 \times 2\text{B} \times 2\text{B} = 12\text{B}$. Using the same formula as above, but being careful to include both `title` and `publishYear` properties, the calculation is: -$2584 \times (88\text{B} + 13\text{B} + 12\text{B} + 16\text{B} + 16\text{B} + 56\text{B}) = 2584 \times 201\text{B} = 519,384\text{B}.$ +$2584 \times (80\text{B} + 13\text{B} + 12\text{B} + 16\text{B} + 16\text{B} + 56\text{B}) = 2584 \times 193\text{B} = 498,712\text{B}.$ -In total, $4,138,356\text{B}$ to store vertices. +In total, $3,964,500\text{B}$ to store vertices. The edges don't have any properties on them, so the formula is as follows: @@ -632,7 +634,7 @@ $\texttt{NumberOfEdges} \times (\texttt{Edge} + \texttt{SkipListNode} + \texttt{ There are 682,943 edges in the Marvel dataset. Hence, we have: -$682,943 \times (40\text{B}+16\text{B}+16\text{B}+56\text{B}) = 682,943 \times 128\text{B} = 87,416,704\text{B}.$ +$682,943 \times (32\text{B}+16\text{B}+16\text{B}+56\text{B}) = 682,943 \times 120\text{B} = 81,953,160\text{B}.$ Next, `Hero`, `Comic` and `ComicSeries` labels have label indexes. To calculate how much space they take up, use the following formula: