Even on a huge memory machine, examples/scala/build_run_example.sh invokes java with -Xmx1g so should be bounded by 1G.
Even so, agreed purposely generating & catching OOM is unsettling, so I reworked to compare representation costs as per your suggestion.