Solaris 中 prstat SIZE 值增加是否表示内存泄漏?
在我的程序中,我创建了 100 个线程,然后等待所有线程加入,然后再次重复此操作。
在每个线程中,我创建一些内存并释放它。我相当确定,我在这些线程中创建的所有内存都将被释放。
但是,prstat 的 SIZE 输出和 RSS 输出正在不断增加。它们定期增加 4M
这些值表明什么?这是否意味着存在内存泄漏?
编辑:
我的初衷是想找出 SIZE 和 SIZE 的含义是什么。 prstat 输出中的 RSS 列。另外,SIZE 显示的值的增加是否证实代码中存在内存泄漏?
In my program, I create 100 threads, then wait for all of them to join and then repeat this operation again.
In each of the threads, I create some memory and free it. I am fairly sure, all the memory which I am creating in those threads are getting freed.
But, the SIZE output and RSS output of prstat are continously increasing. They are increasing regularly by 4M
What do these values indicate? Does it mean there is some memory leak?
EDIT:
My original intention was to find out what is the meaning of SIZE & RSS columns in prstat output. Also, does increase in the value shown by SIZE confirm the presence of memory leak in the code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,prstat SIZE 增加并不一定表明存在内存泄漏。您只能猜测可能存在内存泄漏。此外,当使用标准 Solaris malloc/free 库时,释放的内存不会返回给操作系统,因此 SIZE 指标永远不会减少。您确实应该发布一个展示该问题的示例源代码,以帮助确定您是否确实遇到了内存泄漏。
No, prstat SIZE increase doesn't necessarily indicate a memory leak. You can only guess that there might be a memory leak. Moreover, when using the standard Solaris malloc/free libraries, freed memory is not returned to the OS so the SIZE metric is never decreasing. You should really post a sample source code exhibiting the issue to help figuring out if you really experiencing a memory leak.
是的,内存使用量持续增加表明存在内存泄漏。
Yes, continuously increasing memory usage indicates a memory leak.