I've heard dnf uses a lot of memory, but in my 2GB F38 VM, I can run a large DNF transaction with no problem when logged into GNOME. On 4GB F37 bare metal, in multiuser, even updating one letter at a time isn't enough, even "dnf check" can fail. I read somewhere that GNOME and KDE are the only two DEs that have the necessary protection, but don't quote me on that. I haven't even read up on what "cgroup" means yet.