Restart Appium Server After N Sessions

Hi,

is it possible to restart appium server after N sessions?
I would like to do that to prevent appium server exhaustion because of mem leak bugs etc (we are running hundreds of sessions on appium instance…)

using selenium grid extras is not a good option since it support only restart of the entire machine which is not optimal - we have multiple Genymotion devices and multiple Appium servers on the same machine, no point to lose them all only for single appium server restart.

any solutions? :slight_smile:

thanks,
Roy.

we start appium server when we start testing :slight_smile: and closing it when finishing.
we use testNG and starting appium as process on machine where tests are starting.

Appium process starting beforeSuite and closing afterSuite.