C++ SunOS 上的应用程序存在内存泄漏。如何找到它?

发布于 2024-08-03 04:20:56 字数 353 浏览 5 评论 0原文

我刚刚登陆 SunOS:

$ uname -a
SunOS sunfi95 5.9 Generic_122300-13 sun4u sparc SUNW,Sun-Fire-880

并拥有 Sun studio:

$ CC -V
CC: Sun C++ 5.8 2005/10/13

如何在代码中找到 memleaks? (在这种情况下,dbx 不是一个选项)。 Valgrind 不适用于 sparc 系统,我想到的唯一解决方案是使用一些智能库,该库将重载 new 和 delete 并计算它们被调用的次数。 有人知道 BSD 上有类似许可证的东西吗?

i just landed on SunOS:

$ uname -a
SunOS sunfi95 5.9 Generic_122300-13 sun4u sparc SUNW,Sun-Fire-880

and have Sun studio:

$ CC -V
CC: Sun C++ 5.8 2005/10/13

How I can find memleaks in code? (dbx is not a option in this case).
Valgrind does not work on sparc systems, only one solution that cross my mind is to use some smart lib that will overload new and delete and count how many times they are called.
Anyone know something that is on BSD like license?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

黑色毁心梦 2024-08-10 04:20:56

在 Sun OS 上,您可以使用 Purify,或者尝试移植(通常您也会将泄漏移植到 Unix/Linux 上,并使用 valgrind 来查找泄漏。

On Sun OS you can use Purify, or try to port(generally you'll port the leak, too) your program to Unix/Linux and use valgrind to find the leak.

Spring初心 2024-08-10 04:20:56

DTrace 对于了解 Solaris 应用程序中发生的情况非常有用。

以下是如何在 Sun 中使用它的示例。

DTrace can be very useful for working out what's going on in Solaris applications.

Here's an example of how to use it from Sun.

世界和平 2024-08-10 04:20:56

我认为有免费软件库,但我们在 Solaris 上使用 Purify,效果很好。

I think there are freeware libs but we use Purify on Solaris which works well.

固执像三岁 2024-08-10 04:20:56

您还可以使用名为 cppcheck 的应用程序来查找内存泄漏,以及许多其他问题。它是一个免费/开源产品。

我从未在 SunOS 或 Sparc 机器上使用过它,但源代码是可用的,您可以尝试构建它。我不确定幕后发生了什么,但我不明白为什么不能在 SunOS Sparc 机器上构建它。

You can also use an application called cppcheck to find memory leaks, as well as a number of other problems. It's a free/open source product.

I've never used it on SunOS or Sparc machines, but the source is available and you could try to build it. I'm not sure what goes on under the hood, but I don't see why you couldn't build it on a SunOS Sparc machine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文