We have found that a "Refresh" on an ArcGISDynamicMapServiceLayer causes a memory leak. The memory consumed by the browser continues to grow each time the layer is refreshed. This is a real problem when you are trying to monitor changes such as location or attributes for a particular layer. The only way we have found to release the memory is to close the browser and start over, which is unacceptable to our users.
Here is some sample code that has a button to refresh a dynamic map layer from arcgisonline. Each time you click refresh the memory grows.
--- Is there something we need to do to release the memory each time the layer is refreshed? Are we doing something wrong here, or is this a real bug? Has anyone else seen this?