Mongod Taking up all available RAM and won't give it back

I run mongodump twice a day via a cron for backups. As of late my database has gotten large (10k collections with and average of 5k documents in each. There’s about 20 collections with millions of documents. The backup last night killed the server because it pushed mongod (version 4.0.28) memory usage to take up all available RAM. I have this set in the mongod config

        cacheSizeGB: 2

but mongod seems to ignore that. I ran the backup again watching it with nothing hitting the database and it worked but after about 2 hours now mongod has not released the additional memory mongodump caused it to take.

When it failed, mongod was using all available memory and the server crashed.

The only non-OS (Ubuntu 18) processes that are running are mongod and mongodump so if there’s a memory leak its in one of those.

Is there some way to unequivocally tell mongod its memory usage limits?