Apparently there are thousands of code modules and Soong keeps literally everything in memory while calculating dependencies? Which makes me wonder what the hell the blueprint files actually do if it's still so absurdly heavy.
Considering how the requirements went from four gigs to over thirty over the years, it wouldn't shock me if RAM use grows exponentially with the number of modules and they just put up with it because the Google devs use cloud machines with practically infinite resources for building and therefore don't have any impetus to fix it.