> > > > My team is developing a service platform on OSGi platform. > One big concern of my boss is bundle resource monitoring/profiling on > service bundles. > That is, if a service bundle eats too much memory or CPU, can OSGi runtime > detect this event and take some action? > >
I think the only way to do it in stock jvm & OSGi is to take advantage of java security API which gives you the possibility collect bundle metrics as they call through the security API. This gives you access to all classloading, thread management, resource access, etc. You will have to write a custom SecurityManager which tracks bundle metrics, and also supports OSGi enhanced java security (perhaps extending an existing implementation like org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager). It will not be trivial, but it is as close as you can get in stock java APIs (that or instrumenting the JVM, java.lang.instrument). Furthermore, expect a considerable performance degradation, even without customization, when using java security because it's quite intense. -- *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile> <http://twitter.com/#!/rotty3000> | Senior Software Architect | *Liferay, Inc.* <http://www.liferay.com> <https://twitter.com/#!/liferay> --- 8-9 October 2012 |* Liferay **North America Symposium* | liferay.com/northamerica2012 <http://www.liferay.com/northamerica2012> 16-17 October 2012 |* Liferay **Europe Symposium* | liferay.com/europe2012<http://www.liferay.com/europe2012> 24-25 October 2012 |* Liferay **Spain Symposium* | liferay.com/spain2012<http://www.liferay.com/spain2012>
_______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev