调试时直观地查看虚拟内存使用情况
这可能是一个很大的问题,但是有没有什么工具可以让我查看 Linux 中进程的虚拟内存使用情况?我说的是详细的、可能是内存的图形视图,包括当我在调试器中单步执行程序时,保留地址、BSS/文本/等段、堆、堆栈增长等的内容?
This might be a big ask, but are there any tools that let me view the virtual memory usage of my process in Linux? I am talking detailed, probably graphical view of memory, including what is going into the reserved addresses, the BSS/text/etc segments, heap, stack growth, etc, while I am stepping over the program in a debugger?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我曾经使用pmap来监控内存消耗。它对我发现内存泄漏的根源有很大帮助。它远非图形化,但您可以从中学到很多东西。
I once used pmap to monitor memory consumption. It helped me a lot in discovering the source of a memory leak. It's far from being graphical but you can learn quite a lot from it.
好问题。对于广泛的观点,也许只是继续转储 /proc/pid/maps ?我认为上面提到的 pmap 显示了来自此处的信息。但我猜你正在谈论特定的小分配/释放。
Good question. For broad views, maybe just keep dumping /proc/pid/maps? I think pmap, mentioned above, shows info from here. But I guess you are talking about specific small allocs/deallocs.