Skip to content
simongog edited this page May 19, 2012 · 2 revisions

The space usage of all sdsl data structures can easily be determined using two utility functions:

size_t size_in_bytes = get_size_in_bytes(bv);

and

size_t size_in_mb = get_size_in_mega_bytes(bv);

both functions write the data structure to a dummy output stream while counting the number of bytes written.

With these handy functions it is possible to create a memory usage breakdown for a really complex succinct data structure like a compressed suffix tree. The following picture shows a visualisation (produced with R) of such a breakdown for one possible parametrisation for the compressed suffix tree class cst_sct3: Space Breakdown Example 1