That is what I am trying to do, but I do not know how to unload the wordpress modules.
I have a non-WP database. I select * from a table and iterate over all the results. Each row gets its own WP post. selecting all and iterating over the entire table does no use up too much memory.
Forcing an unload of the wp environment would be a really easy way to chunk up this task.