# Monitoring Database Storage in xSQL

> Sometimes it is useful to see the amount of database memory space available in the database. xSQL provides the `mem` command for this purpose. It displays the amount of total and free storage in the database. The available storage is displayed in bytes (-b), Kilobytes (-k, default), Megabytes (-m), Gigabytes (-g), Terabytes (-t) or memory pages (-p)

>         XSQL>mem [-b|-k|-m|-g|-t|-p]

> For example, the following displays memory usage for an in-memory database:

>         XSQL>mem
>         Total         Used               Free
>         Mem :    102212            6      	     102205

>         XSQL>mem -b
>         Total         Used               Free
>         Mem : 104665344         6656       	  104658688

> ## Examining Dictionary Memory Usage

> In order to dynamically modify the database layout via the dynamic DDL, the database must have space for dynamically created classes and indexes preallocated (reserved ) in advance. The `memddl` command displays the amount of the reserved space, the already used and available sizes. For example:

>         XSQLCMD>memddl
>         Reserved             Used        Available
>         Classes    :              100                1               99
>         Indexes    :             1000                1              999
>         Dict. size :             32Kb              0Kb             31Kb

> ## Persistent Databases

> The `mem` command displays the following persistent storage usage for a persistent database :

>         XSQL>mem
>         Total            Used            Free
>         Mem :    102154              12          102141
>         Disk:       128             121

>         Log :       833