kuujo / vertigo

Flow-based programming for the Vert.x application platform.
Apache License 2.0
155 stars 24 forks source link

Shared Data filling up when deploying/undeploying networks generating OutOfMemory errors #41

Open gdepourtales opened 10 years ago

gdepourtales commented 10 years ago

Hi

First of all thanks a lot for bringing us Vertigo. It's a very valuable piece of software.

Our use case makes use of many networks deploying/undeploying them many times. After a while we experienced always OutOfMemory errors. After investigating with VisualVM, we found out that the PermGen was filling out with new classes being loaded and never removed.

After experimenting a bit, we added the following lines after undeploying to clean the shared data left by vertigo :

vertigo.undeployNetwork(DEFAULT_CLUSTER, networkName);
// Clean up Shared Data
getVertx().sharedData().getSet(DEFAULT_CLUSTER).remove(networkName);
getVertx().sharedData().removeMap("default." + DEFAULT_CLUSTER + "." + networkName);
getVertx().sharedData().removeMap("default.deployments." + DEFAULT_CLUSTER + "." + networkName);
getVertx().sharedData().removeMap(DEFAULT_CLUSTER + "." + networkName);

After adding those 4 lines, we don't get any OutOfMemory anymore.

Are we doing something wrong (for example forgetting to unregister components or removing components) ?

Thanks

kuujo commented 10 years ago

Awesome! It's definitely a bit of cleanup that's needed. I'll double check on whether anything else needs to be cleaned up, but I think this should be good.

gdepourtales commented 10 years ago

Hi Jordan. Thanks a lot !