0

I am new to YourKit profiler and after reading some good reviews wanted to give it a try . I am trying to profile a webapp running in weblogic application server. I basically want to check how many instances of a particular class got created between the time I start recording and the time when I stopped recording object allocation. How can I do that? I would also like to know the stacktrace for those object creation methods. For doing this do I also have to capture memory snapshot after starting allocation recording? If yes, then why?

4

1 回答 1

1

我基本上想检查在我开始记录和停止记录对象分配之间创建了多少特定类的实例。我怎样才能做到这一点?

查找记录的数量,例如搜索分配下的类。如果您记录每 10 次分配,则将其乘以 10 以估算数量。如果您需要准确的数字,您需要记录创建的每个实例(这会减慢您的应用程序)

我还想知道这些对象创建方法的堆栈跟踪。

您可以通过查看这些分配发生的位置来获得这些堆栈跟踪的摘要。

为此,我是否还必须在开始分配记录后捕获内存快照?

我怀疑这是开箱即用的支持,因为拍摄快照非常非常昂贵。但是 YourKit 提供了一个 API,您可以在每次创建此对象时通过将其添加到要跟踪的对象的构造函数中以编程方式触发快照。

于 2013-07-29T08:30:52.683 回答