It depends on what you mean by “a specific permutation”.
Getting a random one is easy, no need to iterate.
Perhaps you can figure out a smart way to get to your permutation without iterating at all.
If you really want to play with the full list of permutations, one way to avoid memory problems could be to create an sqlite database in memory and execute a join query. Perhaps sqlite is smart and creating a query that searches from the result of a subquery that creates the permutations on the fly will be memory efficient.
Perhaps pandas
could help too.