Is there a way to find out how much memory a table is using?

No. You can look at overall memory usage in the UI, but there's not a way to look at memory usage by a single table. You can approximate how much memory it uses based on the table's size and data types. Tables also use memory for their row set — the structure that tracks which row keys the table contains — and for any state that operations such as joins and aggregations keep.

We have some general advice, however:

  • Review your query to see if it is using "expensive" operations.
    • update stores each new computed column in memory. A billion-row table with one new long column needs at least 1 billion * 8 bytes. Columns with a constant value (such as X = 5) and columns that copy an existing in-memory column (such as Y = X) don't need this per-row storage.
    • Joins can be expensive when there are many unique join keys.
    • Joins and sort can be expensive on very large tables, depending on where the rows come from and how they are ordered.
    • Anything that creates many small row sets, such as group_by or partition_by (one per group or partition), can also use a lot of memory.
  • Look at memory usage in the Query Operation Performance Log (QOPL).
    • This works best when the query starts from tables that already hold a lot of data (e.g., a million-row table rather than an empty table that fills as data from a Kafka stream is ingested). Look at the FreeMemoryChange column in the QOPL to see JVM-wide memory changes, and the AllocatedBytes column to see how much memory the operation allocated (including any parallel work). Neither measures retained table memory directly, and other activity and garbage collection can affect FreeMemoryChange, but an expensive update or join is often readily apparent.

Note

These FAQ pages contain answers to questions about Deephaven Community Core that our users have asked in our Community Slack. If you have a question that is not in our documentation, join our Community and we'll be happy to help!