This appears to be a memory leak. I'm able to reproduce it with:
http://github.com/atdixon/piccolo2d-examples/blob/master/src/main/java/atdixon/piccolo/example/ActivityMemoryLeakExample.java
The problem is that PActivityScheduler keeps a list of
"processingActivities" that it only clears when a new batch of
activities are to be executed. So if you run a bunch of activities on
a bunch of nodes just once, and then remove those nodes from the
layer, etc., they won't be gc'd b/c they will still be referenced by
private PActivityScheduler state. A workaround is to issue a "no-op"
activity after all your activities have run and you should see the
memory freed up.
Piccolo2d developers, I think the simple fix is to clear the
processingActivities list in PActivityScheduler#processActivities()
after the iteration in that method. Should I open a bug?