简体   繁体   English

Java Interactive Profiler 可以分析 osgi 捆绑包吗?解决方法是什么?

[英]Can Java Interactive Profiler profile osgi bundles?what is the workaround?

you need to specify classloader to select classes to profile in JIP.But in OSGi platform each bundle has separate class loader which is decided dynamically.您需要将类加载器指定到 select 类以在 JIP 中进行分析。但是在 OSGi 平台中,每个包都有单独的 class 加载器,这是动态决定的。 JIP has its own advantages.How do other profilers (yourkit,visualvm ) provide profiling for osgi bundles? JIP 有自己的优势。其他分析器(yourkit、visualvm)如何为 osgi 包提供分析?

Try to look at http://code.google.com/p/jip-osgi/ .尝试查看http://code.google.com/p/jip-osgi/ It is described as based on jip profiler that allows to monitor resources in OSGi application.它被描述为基于 jip profiler,允许监视 OSGi 应用程序中的资源。

The profilers I've worked with do byte code manipulation that will inject their code in your classes.我使用过的分析器会进行字节码操作,将它们的代码注入到你的类中。 When you perform that on bundles, suddenly these bundles have a dependency on these extra classes which is resolved by putting those bundles on either the bootclasspath (the easiest, but also most implicit way) or exposing them via the system bundle (more explicit, but it requires your annotated bundles to import those classes/packages).当您在捆绑包上执行此操作时,突然这些捆绑包依赖于这些额外的类,这可以通过将这些捆绑包放在引导类路径(最简单但也是最隐含的方式)或通过系统捆绑包公开它们来解决(更明确,但它需要您带注释的包来导入这些类/包)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM