'Nexus cleanup policies very slow and making nexus OOM

I have a 32gb nexus (latest version) setup, with their suggested memory settings. Everything is fine, but when the scheduled cleanup happens using the cleanup policies, nexus becomes discernibly slower, seems to use up a lot of memory and can sometimes OOM.

It takes maybe 5 seconds to delete a single component.

In contrast, if in the UI I just select a load of components to delete, it deletes them much much faster. It can delete 1000 components in under a second.

So what is happening here? My cleanup policies are just 'delete snapshots if they're old and haven't been downloaded', so I can't see why this operation should use lots of memory and be slow.

I could just script it and avoid these cleanup policies I suppose.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source