The portdbapi aux_get method aggressively caches metadata in memory. This behavior can cause applications to consume much more memory than necessary. It would make sense for the aggressive cache behavior to be enabled by the existing "frozen" flag, so that it is disabled by default. Doing so will not affect depgraph performance, since depgraph caches the metadata separately, via Package instances.
There's a patch in the following branch:
Looks, good. If only all patches were that simple ;)
Thanks, this is in the master branch:
Fixed in 2.2.28.