有什么工具可以可视化程序中使用的对象吗?

时间:2021-06-10 01:18:43

I'm not sure how useful this would be, but I thought it might be neat to visualize the objects being used in my program and which objects are being referenced from where. I'm guessing it would generate some data that would be used by a program like graphviz. Are there any tools that do this, otherwise how hard would it be to do this myself? Ideally this would work for any arbitrary program, though if necessary I could make some modifications to the code (such as to add a dumpObjects() call or whatever)

我不确定这有多有用,但我认为可视化程序中使用的对象以及从何处引用的对象可能会很好。我猜它会生成一些数据供graphviz这样的程序使用。有什么工具可以做到这一点,否则我自己做这件事有多难?理想情况下,这将适用于任意的程序,不过如果有必要的话,我可以对代码做一些修改(比如添加一个dumpObjects()调用之类的)

I'm interested in doing this for java, but if there are solutions for other languages please post those too.

我对java很感兴趣,但是如果有其他语言的解决方案,也请贴出来。

6 个解决方案

#1


9  

A profiler would allow you to see what objects are created at runtime. This is the output of JProfiler for instance:

分析器允许您查看在运行时创建的对象。这是JProfiler的输出:

jprofiler heap walker http://www.ej-technologies.com/products/jprofiler/images/screenshots/heap_walker_references_fsb.png

jprofiler堆沃克http://www.ej-technologies.com/products/jprofiler/images/screenshots/heap_walker_references_fsb.png

#2


2  

Sun have developed the VisualVM which includes memory and process profiling. It also supports plugins for technology such as OSGi.

Sun开发了包括内存和进程分析的VisualVM。它还支持像OSGi这样的技术插件。

#3


1  

An interesting use case would be memory analysis and optimization. This is precisely what Eclipse MAT is about. Check it out.

一个有趣的用例是内存分析和优化。这正是Eclipse MAT的目的。检查出来。

alt text http://dev.eclipse.org/blogs/memoryanalyzer/files/2008/05/dom_tree.gif

alt文本http://dev.eclipse.org/blogs/memoryanalyzer/files/2008/05/dom_tree.gif

#4


1  

For visualising graph structures (including object graphs), there are lots of tools based on GraphViz: http://www.graphviz.org/

对于可视化图形结构(包括对象图),有很多基于GraphViz: http://www.graphviz.org/的工具

#5


1  

There is the Object Graph Visualizer which displays classes and objects in 3D. For now it lacks an API to automate the initialization, however it shouldn't be too difficult to add this functionality. Source code also on Github.

有一个对象图可视化工具,它以3D的方式显示类和对象。目前它缺乏一个API来自动初始化,但是添加这个功能应该不会太难。Github上也有源代码。

Edit: There is already work being done in that direction apparently: https://eprints.hsr.ch/491/

编辑:显然已经在这个方向上完成了工作:https://eprints.hsr.ch/491/

有什么工具可以可视化程序中使用的对象吗?

#6


0  

not sure if that is what you are aiming at, but Doxygen will do pretty much all of that.

不确定这是不是你的目标,但Doxygen会做几乎所有这些。

it will take a heap of compiling code and turn it into cross referenced html, rtf of pdf. completed will calling tree for each function and "referenced by " for each variable

它将编译一堆代码并将其转换为交叉引用的html,即pdf的rtf。完成后将为每个函数调用树,并为每个变量“引用”

#1


9  

A profiler would allow you to see what objects are created at runtime. This is the output of JProfiler for instance:

分析器允许您查看在运行时创建的对象。这是JProfiler的输出:

jprofiler heap walker http://www.ej-technologies.com/products/jprofiler/images/screenshots/heap_walker_references_fsb.png

jprofiler堆沃克http://www.ej-technologies.com/products/jprofiler/images/screenshots/heap_walker_references_fsb.png

#2


2  

Sun have developed the VisualVM which includes memory and process profiling. It also supports plugins for technology such as OSGi.

Sun开发了包括内存和进程分析的VisualVM。它还支持像OSGi这样的技术插件。

#3


1  

An interesting use case would be memory analysis and optimization. This is precisely what Eclipse MAT is about. Check it out.

一个有趣的用例是内存分析和优化。这正是Eclipse MAT的目的。检查出来。

alt text http://dev.eclipse.org/blogs/memoryanalyzer/files/2008/05/dom_tree.gif

alt文本http://dev.eclipse.org/blogs/memoryanalyzer/files/2008/05/dom_tree.gif

#4


1  

For visualising graph structures (including object graphs), there are lots of tools based on GraphViz: http://www.graphviz.org/

对于可视化图形结构(包括对象图),有很多基于GraphViz: http://www.graphviz.org/的工具

#5


1  

There is the Object Graph Visualizer which displays classes and objects in 3D. For now it lacks an API to automate the initialization, however it shouldn't be too difficult to add this functionality. Source code also on Github.

有一个对象图可视化工具,它以3D的方式显示类和对象。目前它缺乏一个API来自动初始化,但是添加这个功能应该不会太难。Github上也有源代码。

Edit: There is already work being done in that direction apparently: https://eprints.hsr.ch/491/

编辑:显然已经在这个方向上完成了工作:https://eprints.hsr.ch/491/

有什么工具可以可视化程序中使用的对象吗?

#6


0  

not sure if that is what you are aiming at, but Doxygen will do pretty much all of that.

不确定这是不是你的目标,但Doxygen会做几乎所有这些。

it will take a heap of compiling code and turn it into cross referenced html, rtf of pdf. completed will calling tree for each function and "referenced by " for each variable

它将编译一堆代码并将其转换为交叉引用的html,即pdf的rtf。完成后将为每个函数调用树,并为每个变量“引用”