To and Dirk-FU. I was wrong to say memory leaks. The issue is memory heap or allocation, or both. The Timer thing is interesting, but it make no noticeable difference.
I added a an init() with a print statement to ViewModel and ContentView. They only instantiate once.
I've also tried compiling a release version. According to Activity monitor, this has a smaller footprint to begin with, but slowly grows, and by even more as the button is pressed.
The thing is, this is a little test app to try and figure out what's going on in my real app. My real app has over 40 Buttons, 8 Pickers with dynamic arrays, and a graphical 'spectrum scope' with a graticule and a filled polygon shape. All interacting with 2 network sources in real time. This does have memory leaks and heap allocation issues - at about 100kB per second.
I've been experimenting where each class is instantiated - without any success so far.
As you can tell, I'm a novice. It would help if Apple's documentation told me what's going on. For example, they say the UI runs on the main thread, but they don't say if that applies in a Button closure. In Activity Monitor I can see more threads than I would have expected.