AnsweredAssumed Answered

No more handles (SWT Error) while batch processing .gdb in python

Question asked by mdekys_bagira on May 31, 2017
Latest reply on Sep 25, 2017 by SHaegler-esristaff



I am processing large number of .gdb files the following way:


  1. load 500 .gdb objects in CE
  2. process these 500 objects
  3. export them as .gdb
  4. repeat


during this process, CE briefly displays and closes import and export gdb dialog windows as it should but after few iterations (the above process is repeated ~500 times) It hangs up on one of these dialog windows and the script stops, UI freezes thus CE is irresponsible and I can't do anything with it other than close it. When I restart it, everything works as it should after I run the script again and it does another 500 iterations..


the problem that it displays is on the following screenshots - I am unable to post .logs of all the errors because UI is frozen at this state so I cannot open "save log" dialog window but I migh be able to make screenshots of all of them if it is necesarry:




I was searching about this "no more handles SWT error" and found out that it's a common eclipse bug that has something to do with limited number of handles that OS provides to eclipse and when these handles run out an error occours or maybe it's a memory problem but I have 32GB and CE only uses 9GB


Maybe this is not CE-related bug and more like Eclipse-related but I would like to ask if anybody has any idea how to fix it or workaround:



Possible solutions that I can think of:

  1. increase number of handles that OS provides somehow (maybe edit something in CityEngine.ini)
  2. make CE cleanup itself after some iterations (~400) by using some python code (maybe run garbage collector etc..)
  3. force CE to close after some iterations (~400)  and then start again and continue where it left - and repeat - this can work - I can restart CE but I don't know how to force it to run a specific script after startup


any help is appreciated