1

这是我在 valgrind 崩溃并停止分析我的应用程序时收到的消息:

    ==16317== 
    ==16317==     Valgrind's memory management: out of memory:
    ==16317==        newSuperblock's request for 4194304 bytes failed.
    ==16317==        3013349376 bytes have already been allocated.
    ==16317==     Valgrind cannot continue.  Sorry.
    ==16317== 
    ==16317==     There are several possible reasons for this.
    ==16317==     - You have some kind of memory limit in place.  Look at the
    ==16317==       output of 'ulimit -a'.  Is there a limit on the size of
    ==16317==       virtual memory or address space?
    ==16317==     - You have run out of swap space.
    ==16317==     - Valgrind has a bug.  If you think this is the case or you are
    ==16317==     not sure, please let us know and we'll try to fix it.
    ==16317==     Please note that programs can take substantially more memory than
    ==16317==     normal when running under Valgrind tools, eg. up to twice or
    ==16317==     more, depending on the tool.  On a 64-bit machine, Valgrind
    ==16317==     should be able to make use of up 32GB memory.  On a 32-bit
    ==16317==     machine, Valgrind should be able to use all the memory available
    ==16317==     to a single process, up to 4GB if that's how you have your
    ==16317==     kernel configured.  Most 32-bit Linux setups allow a maximum of
    ==16317==     3GB per process.
    ==16317== 
    ==16317==     Whatever the reason, Valgrind cannot continue.  Sorry.

我尝试过使用巨大的交换文件,但它并没有变得更好。崩溃发生在我的交换文件快满之前很久。我正在使用 Fedora 19。有人对此有所了解吗?我想我在互联网上读到了有关单个进程可以分配的内存如何受到限制的内容。如果是这种情况,我可以在哪里设置它?至少给我一个替代 valgrind 人的好选择:P。

提前致谢

4

1 回答 1

0

" 大多数 32 位 Linux 设置允许每个进程最多 3GB。"

您分配了 3013349376 字节,非常接近 3GB。所以你可能有一个 32 位操作系统,而你只是用完了单个进程的内存(其他 ~200 兆可能是 valgrind 开销)

于 2013-11-03T08:31:15.630 回答