'''LDAP的内存泄露''' ''-- Python说:不是俺的错!'' 2006-03-17 18:42:23 ---- [[TableOfContents]] ---- 故事: 友人在折腾[http://www.openldap.org/ LDAP] ,使用Python 的 [http://twistedmatrix.com/ Twisted] 组件来开发时应用常常死亡, 怀疑Python的内存泄露,但是找不到证据…… 结局: 找到高人[http://blog.delphij.net/ delphj] 运用内存分析工具: {{{ /usr/ports/devel/valgrind> cat pkg-descr Valgrind is a system for debugging and profiling un*x programs. With the tools that come with Valgrind, you can automatically detect many memory management and threading bugs, avoiding hours of frustrating bug-hunting, making your programs more stable. You can also perform detailed profiling, to speed up and reduce memory use of your programs. The Valgrind distribution includes five tools: two memory error detectors, a thread error detector, a cache profiler and a heap profiler. Several other tools have been built with Valgrind. Valgrind was ported to FreeBSD by Doug Rabson (http://www.rabson.org/). WWW: http://valgrind.kde.org/ }}} 才发现是[http://www.openldap.org/ LDAP]本身的问题: 每次RPC 的远程连接结束后,会泄露 32字节的内存! 晕哪!怪不得叫 LDAP, 因为很轻的连接情况下的确很不容易发觉,在当前内存动不动就上Gb的情况下………… '''Python的虚拟机是非常坚固的!不要轻易怀疑吧……''' ---- 动力源自::'''[http://txt2tags.sf.net txt2tags]''' ## moin code generated by txt2tags 2.3 (http://txt2tags.sf.net) ## cmdline: txt2tags --target moin /data1/www/blog.woodpecker/pyblosxom/zoomquiet/data/Zen/programme/ldap-valgrind-2006-03-17-17-00.t2t