I wrote up the full 'war story' of how I had to profile the heap and optimize the node representation (shaving bytes off the edge storage) just to get it to boot without an OOM error: https://www.abahgat.com/blog/the-programming-puzzle-that-got...
It’s the most tangible example I've run into of where theoretical O(n) space complexity meets the reality of object pointer overhead.
Also explained by the creator of this: https://www.abahgat.com/project/suffix-tree/
> the human genome can be encoded as a 3GB string constructed out of an alphabet of four characters
> As of 2019, a suffix tree indexing the human genome using state of the art algorithms can easily occupy tens of gigabytes.
But good luck visualizing what those algorithms do :)