OK, spent pretty much the whole day today trying to track down the cause of this and have made some progress.
elements such as inputs etc DO get removed correctly.
However if you add for example a window to the dynamically loaded panel, then this window does not get removed with the panel('clear') and remains attached to the body forever.
In addition, dialogs, menus etc with the same id get appended to the body with each reload which should not happen as ids are supposed to be unique in the dom ?!
This means that if I reload the same page 10 times I will end up with 10 dialogs all with the same ID attribute.
There may be other components that also cause this, but window is the first one I have found.
I also think (but not proved yet) that the following are not removed with panel('clear');
1. Panels
2.Windows
3. Dialogs
4. Menus
http://code.reloado.com/uqinek3/3/edit