keySet() relies on QueryOperation. The QueryOperation doesn't accept IterationType - it always returns both keys & values. This can lead to unnecessary load and potentially even OOM.
It's especially painful when values are larger than keys.
kudos to @Donnerbart for pointing this out!
Is this also an issue with map.values? So you are only interested in values, but do you get the keys as well?
good point @Donnerbart 👍
I will close this one in favor of #5634, since it has some test code.