使用gflag + ust,进程内存增加得更快 [英] Process memory increases much faster with gflags +ust

查看:353
本文介绍了使用gflag + ust,进程内存增加得更快的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在Windows应用程序中查找某些内存泄漏时,我遇到了 gflags 的问题.

I've got stuck in a problem with gflags when trying to find some memory leaks in a windows app.

当我打开 ust 标志(为了收集内存分配堆栈跟踪)时,我的应用程序的内存增加得比标志关闭时要快得多(在10中达到800MB)最小aprox.距离标志关闭时的50-100MB/天还很远).

When I turn on the ust flag (in order to collect memory allocations stack traces) the memory of my application increases much faster than it does when the flag is off (it reaches to 800MB in 10 min aprox. which is far from the 50-100MB/day I get when the flag is off).

我读到堆栈跟踪的最大数量为32MB,所以我认为这应该不是问题.

I've read that there is a maximum for stack traces of 32MB, so I suppose this shouldn't be a problem.

计算机是 4倍Intel(R)Xeon(R)CPU E5410 @ 2.33GHz .

如果有人可以给我一些提示,我将非常感激.

If someone could give me some hint I'd really appreciate it.

谢谢!

推荐答案

堆栈跟踪数据库并不是ust标志的唯一影响.它还为每个分配添加至少32个字节,以存储其堆栈跟踪ID.如果涉及许多小的分配,这可以解释您的内存增加. 如果使用附加的调试器启动进程或使用调试目标编译进程,则Windows堆将设置为调试模式,并且每次分配的开销将更大.

The stack trace database is not the only impact of the ust flag. It also adds at least 32 bytes to each allocation, in order to store its stack trace id. This could explain your memory increase if lots of small allocations are involved. If you launch the process with an attached debugger or compiled the process with debug target, the windows heaps will be set in debug mode and the overhead per allocation will be even bigger.

这篇关于使用gflag + ust,进程内存增加得更快的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆