[FreeNX-kNX] Memory leak in nxagent, with patch

pegasus pegasus at ifdo.pugmarks.com
Wed Feb 21 22:06:06 UTC 2007


Due to having long sessions, I've been afflicted by memory leaks in
nxagent. Such leaks can be visually seen at:
http://img57.imageshack.us/img57/3018/memorymonthbl4.png
The green area, representing total application memory usage for the
whole system, illustrates the leaks: nxagent would go from 30MB
resident to 200+, until I'd finally get pissed off and would restart
the session.

I finally decided to do something about it. The attached patch fixes
those memory leaks. Note that not all leaks are fixed. Essentially all
of the others (that my workload triggers) are in initialisation code,
so they only occur once, and, therefor, have less impact.

The patch should apply cleanly against nxagent-2.1.0-18, currently the
latest available from the NoMachines's source page
(http://www.nomachine.com/sources.php)

The main leak is in nxagentSynchronizeRegion, so it probably affects
most workloads.

Anik

PS: this leak fix was facilitated by valgrind. If you're a C/C++
developer/maintainer and have never looked into it, you should.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nxagent-2.1.0-18-fix-some-mem-leaks.patch
Type: text/x-patch
Size: 3384 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/freenx-knx/attachments/20070221/ca32e33d/attachment.patch>


More information about the FreeNX-kNX mailing list