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: https://github.com/zmedico/portage/tree/bug_576488
Looks, good. If only all patches were that simple ;)
Thanks, this is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a0f48531213976c20190e61dea7100b190f5139f
Fixed in 2.2.28.