AnsweredAssumed Answered

Memory problems running Java Arcobjects custom-built tools

Question asked by peterlen on Aug 21, 2014

We are using ArcGIS 10.0 and I have a toolbox with a couple of custom-built tools using the Java Arcobjects.  The tool's execute method itself doesn't really do anything except call another Java class that is in the same JAR file which does all of the heavy lifting of the task.  What I am running into is a "not enough memory" error.  I had previously seen an article on the use of the ArcGIS JavaConfigTool (ARCGIS_HOME/bin) which is where you can set some JVM parameters like minimum and maximum heap size.  I have modfied these to include the values that I use when testing my code in Eclipse (the maximum heap size is set to 1024m).  I don't get any memory issues when running from Eclipse for the same task, and in fact I am seeing memory issues with my tool when it is called via the toolbox for a task where I do NOT see the memory problem when I run my Java app from the command line without any heap size changes.  The only difference running my app from the command-line or from Eclipse is that I am not callig my app's main class via the tool class and I am not running in the ArcGIS environment.  That makes me think that ArcGIS has other items using the JVM besides mine and thus will be using those heap size changes on other items besides my tool.


Does anyone have any thoughts on why my JVM memory is being consumed more when running in the ArcGIS environment then when I run my app in stand-alone mode even though I increased the ArcGIS JVM settings?


Thanks - Peter