False alarm. The memory use is from this line:
Comment that out and some commands cause a drop in free memory as they set up stuff (or call stuff) but that then remains static through further commands. More importantly, my code now works as expected, which is a plus