NetLogo / NW-Extension

This is the NetLogo Network Extension. For general information about NetLogo, see:
http://ccl.northwestern.edu/netlogo/
Other
62 stars 25 forks source link

ressources saturation when loading networks based on Gephi #157

Closed samthiriot closed 9 years ago

samthiriot commented 9 years ago

Hello,

I was using the controlling API to load inside Netlogo networks and run simulations on them. I tried the nw:load-gml primitive and observed a huge general slowdown in the JVM after several runs.

After investigating, new event threads are created everytime a network is readen. They are responsible of this slowdown. It is not perceptible in a standard use, but becomes problematic once you load networks hundreds of times throught the controlling API, as JVMs are known to be imperfect when it comes to run hundreds of threads.

To reproduce the problem, you can either:

After having a look to the sourcecode, I see most network formats are provided by Gephi. Unfortunatly, and despite of its numerous qualities, Gephi is a bit greedy when it comes to threads. Everytime you create or convert a network, some threads are created to transmit events. We had a discussion some time ago on the Gephi forums which disappeared since. At that time they had not found any workaround enabling to stop the threads after using the network.

qiemem commented 9 years ago

Thanks for bringing this up. I've been trying to reproduce these problems by running nw:load-gml (and other load functions) hundreds of times. I can see that new threads are sometimes created during this process, but it looks like they're always correctly shutdown and GCed afterwards. After running approximately 1000 loads (on small networks) my live thread count is sitting at 20 (monitoring with VisualVM, so a few are RMI threads).

This leads me to believe that Gephi and NW on their own do not leak threads.

Would you post the relevant parts of your code where you're using the controlling API?

SethTisue commented 9 years ago

sounds like maybe you are creating instances of HeadlessWorkspace and then not calling dispose on them when you're done with them?

samthiriot commented 9 years ago

Hello !

Thanks for investigating. I tried to create a minimalistic code for reproducing the error, and end with the same conclusions as you do when comparing graphml and gml - even without disposition the workspace, for instance to reuse it and avoid the overhead of compilation everytime.

So I assume it as to be on my side... sorry for the wrong report then... :-/

qiemem commented 9 years ago

No worries! Thanks for reporting anyway!