如何使用 vgdb 在 Valgrind Massif 中强制创建新快照?
我使用 Valgrind
和 massif
工具来监视发生内存分配的所有代码部分。在本例中,我使用此命令使用 Valgrind
运行我的程序:
valgrind --tool=massif --vgdb=full --pages-as-heap=yes --detailed-freq=1 --threshold=0.001 --max-snapshots=100 --time-unit=ms ./myprogram
我的问题是,运行程序 30 分钟后,它开始分配更多内存。我想监视代码的哪些部分正在分配内存。我应该注意到,这不是内存泄漏,因此我没有使用 Memcheck
而是使用了 massif
。该命令一开始从内存中获取快照,但之后,我就没有内存中的快照了。
为了解决这个问题,我使用 vgdb
命令按照以下方式拍摄详细快照:
vgdb detailed_snapshot
但看起来这个命令正在使用捕获的快照,而不是新的快照。那么如何在需要时拍摄新快照呢? 或者我应该以某种方式释放捕获的快照?
I am using Valgrind
with the massif
tool to monitor all parts of code that memory allocation occurs. In this case, I used this command to run my program using Valgrind
:
valgrind --tool=massif --vgdb=full --pages-as-heap=yes --detailed-freq=1 --threshold=0.001 --max-snapshots=100 --time-unit=ms ./myprogram
My problem is that after 30 mins of running the program, it starts allocating more memory. I want to monitor that which parts of the code are allocating memory. I should notice that this is not a memory leak so I didn't use Memcheck
rather I used massif
. This command takes snapshots from memory at the beginning but after that, I have no snapshots from memory.
To solve this problem I used the vgdb
command to take detailed snapshots in the way below:
vgdb detailed_snapshot
But looks like this command is using the captured snapshot, not a new one. So how can I take a new snapshot when I want?
Or should I release the captured snapshot in some way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论