Comments (2)
多谢你的修改建议,这样修改确实能改进代码。
不过不明白原来的方式为啥会有内存泄漏呢?能否给出内存��
�漏工具的检测结果呢?
Original comment by [email protected]
on 21 Aug 2013 at 3:47
from tcpcopy.
利用valgrind运行了一下:
[root@hz0-12-162 tcpcopy]# valgrind --tool=memcheck --leak-check=yes
--show-reachable=yes ./tcpcopy -x 514-10.120.12.148:514 -n 2 2>memcheck.txt
复制两份到测试系统,显示没有内存泄漏
==20013== Memcheck, a memory error detector.
==20013== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==20013== Using LibVEX rev 1658, a library for dynamic binary translation.
==20013== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==20013== Using valgrind-3.2.1, a dynamic binary instrumentation framework.
==20013== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==20013== For more details, rerun with: -v
==20013==
==20013==
==20013== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 1)
==20013== malloc/free: in use at exit: 0 bytes in 0 blocks.
==20013== malloc/free: 53 allocs, 53 frees, 11,379 bytes allocated.
==20013== For counts of detected errors, rerun with: -v
==20013== All heap blocks were freed -- no leaks are possible.
并没有显示内存泄漏
Original comment by [email protected]
on 21 Aug 2013 at 9:24
from tcpcopy.
Related Issues (5)
- packaging for Archlinux users HOT 5
- 0.3.1编译错误 HOT 3
- can not bind:: Address family not supported by protocol HOT 3
- test HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tcpcopy.