Analysing the size of Lepiter databases
This page provides an analysis of the memory used by Lepiter databases, using GtLepiterMemoryMetrics
for the default logical database and GtLepiterDatabaseMemoryMetrics
for each database. See also Analysing the size of code-related entities and Analysing the size of the code index.
For performance reasons the results are cached in GtLepiterMemoryMetrics
. Computing them walks over all objects of the databases and can take several seconds. They can be reset using the snippet below.
GtLepiterMemoryMetrics reset
The databases of the default logical database use 31.96 MiB of the heap. The GT Book is the only database saved in the image, and uses 31.90 MiB. Other databases, like the primary database, are loaded at startup.
The size of each category, over all databases and for the GT Book:
Each page and snippet, and then the database itself, is a root of the estimation. Each root is split into categories by an attribution (GtMemorySpaceAttribution
): for example, the object in the slot text of a snippet, and everything reachable from it, goes to the Text category. A GtMemorySpaceEstimator
walks the objects and counts every object once, in the category of the first slot that reaches it. The walk stops at other pages and snippets, databases, classes, methods, symbols, announcement subscriptions and UI objects. The sizes are estimates: shared objects are attributed to the first category that reaches them.
The categories, and how memory is attributed to them, are declared in GtLepiterDatabaseMemorySpaceDefinition
. The categories and their descriptions:
How pages and snippets, and the database, are attributed to these categories:
Databases can also be stored in a class (see LeDatabaseClassStore
). Each page is then a method of the storage class, with the JSON of the page in a method comment. The JSON is only in the source files, not in the image. The compiled methods are part of the methods of the image (see Analysing the size of code-related entities), and are not included in the size of the database. The summary of such a database shows their size separately.