How to profile OSGi deployment?

I am starting to develop an OSGi package for an application that will be deployed to a device with some hardware limitations. I would like to know how I can profile the execution of this package, to be sure that it will match its dependencies in the final device. It would be nice to have a profiler to find out how much memory is used in each set, to locate bottle necks and compare different implementations of the same service.

Is there any profiler for OSGi deployments or should I use a generic Java profiler?

For development, I use the Pax runner with Apache felix to run the package and maven to manage project dependencies and build.

+4
source share
1 answer

My company is developing OSGi applications for embedded devices. Unfortunately, I don’t know a single tool that has all the features you are looking for. I can tell you what we are doing to deal with the problems you are looking for.

1) Installation on the device: We develop in Eclipse and deploy using Equinox. We create .product files in Eclipse. By doing this, we get solid information about the amount of disk space that our program will take on the device.

2) For profiling we usually use YourKit. There are other good Java profilers, but we have found that this works well for us.

A good technique you can do is create a version of services that acts as a proxy for a real service. A proxy server is a great place to insert a time code, so you can calculate how many calls are made for each method of the service, and determine the time for each call. You can also classify timings based on arguments in such a way as to find poorly executed edges. Then, when you are ready to deploy, you can take out the proxies.

Good luck.

+4
source

Source: https://habr.com/ru/post/1303692/


All Articles