- 论坛徽章:
- 0
|
我将testPool.cpp:30的sleep(-1);改成了sleep(1);
[root@dts threadpool]# make
g++ Log.cpp Thread.cpp Worker.cpp testPool.cpp ThreadPool.cpp Lock.cpp ListenThread.cpp Socket.cpp TaskThread.cpp -lpthread -g -o server
[root@dts threadpool]# valgrind ./server
==29429== Memcheck, a memory error detector.
==29429== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==29429== Using LibVEX rev 1575, a library for dynamic binary translation.
==29429== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==29429== Using valgrind-3.1.1, a dynamic binary instrumentation framework.
==29429== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==29429== For more details, rerun with: -v
==29429==
Bind port 9999 is Successful
Listen thread is starting ....
==29429==
==29429== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 5 from 1)
==29429== malloc/free: in use at exit: 9,464 bytes in 18 blocks.
==29429== malloc/free: 18 allocs, 0 frees, 9,464 bytes allocated.
==29429== For counts of detected errors, rerun with: -v
==29429== searching for pointers to 18 not-freed blocks.
==29429== checked 21,125,256 bytes.
==29429==
==29429== LEAK SUMMARY:
==29429== definitely lost: 0 bytes in 0 blocks.
==29429== possibly lost: 1,440 bytes in 5 blocks.
==29429== still reachable: 8,024 bytes in 13 blocks.
==29429== suppressed: 0 bytes in 0 blocks.
==29429== Reachable blocks (those to which a pointer was found) are not shown.
==29429== To see them, rerun with: --show-reachable=yes
[root@dts threadpool]# uname -a
Linux dts 2.6.9-42.ELsmp #1 SMP Tue Aug 15 10:35:26 BST 2006 x86_64 x86_64 x86_64 GNU/Linux
[ 本帖最后由 chunyv 于 2007-6-4 17:09 编辑 ] |
|