I've been asked to add a feature to a plugin which would allow players to choose a name from an inventory filled with name tags, each given a random name out of maybe 1000. The issue is, I'm horrible with optimization. The way I'm working it is, I'm storing a separate inventory for each player with one open in a HashMap, and to generate the inventory, I use Collections.shuffle() after loading the list of names into a single list, then getting the first 54 entries. The shuffling is done in an async thread. However, this method causes extreme RAM usage and occasionally an OoME. Is there a more efficient alternative to my method of doing this?