Nobody enjoys seeing their applications slow down due to an increase in memory usage. Dynamic Display is a memory intensive approach, so this blog post provides some tips and links to further documentation to help you avoid any possible memory leaks or to check if a there is a memory leak at all.
Since ArcGIS is COM based and we use .NET/Java programming languages to write our applications, it is important to see how these manage memory. A Web help topic on our Resource Centers Web site discusses how to release COM references. The bulleted list below has some general guidelines:
- AoUninitialize.Shutdown should be used to remove libraries for which there is no corresponding COM object.
- The ComReleaser class should be used to release a COM object when it goes out of scope.
- Marshal.ReleaseComObject should be used to explicitly release objects that the .NET garbage collector cannot release.
There is also Web help documentation about the best practices to be used with dynamic display in the ArcGIS framework.
Here's a tip for you: Even though the Windows Task Manager is the easiest way to check for a memory leak, many analysts within Esri Support Services recommend using "Performance" (also referred to as Perfmon and/or Performance Manager) to monitor memory usage. "Performance" generates reports and charts to monitor memory usage. It also provides the option to view “private bytes” and display logs, counters and alerts. The "Performance" tool can be found at Start > Settings > Control Panel > Administrative Tools > Performance.
So, the next time you encounter a performance issue with Dynamic Display, consider the above tips, guidelines, and help documentation. Esri Support Services is always here to help solve any issues you many run into when using our software.
I encourage you to ask questions or leave comments in the comments section. NOTE: You must be logged in to your Esri Global Account to leave comments.
- Ajit M., Esri Support Analyst - SDK group, Esri Support Services