Cape Code Host Memory Leaks
It looks like we are leaking memory in Cape Code where we are retaining classes when we open models.
To replicate this:
- Start up reloadAllAccessors
cd $PTII
$PTII/bin/reloadAllAccessors &
- Start up
- Find the Java process running
ptolemy.vergil.basic.imprt.accessor.ReloadAccessors
- See Memory Leaks (ptexternal wiki) for how to use jvisualvm, especially Dealing with memory leaks in Kepler
- In the monitor tab, note that the amount of memory increases and that GC is taking lots of time:
- Press Heap Dump
- In the Heap Dump, press the Class button then press on Class Name to sort by classes and look for the ptolemy.vergil.basic packages
- In the above, we are not leaking ActorGraphFrame or BasicGraphFrame, but we are leaking some actions
- Click on
ptolemy.vergil.basic.BasicGraphController$OpenBaseClassAction
- In the References section, right click and select Show Nearest GC Root:
- In the above
WebCamDiscoveryService
is highlighted.
At this point, I ran out of time. See Dealing with memory leaks in Kepler for how we could deal with these.