[Qt-interest] QTcpServer - ThreadedFortuneServer memory going up
Stephen Collyer
scollyer at netspinner.co.uk
Thu May 20 21:08:58 CEST 2010
On 20 May 2010 19:56, Tarandeep Singh <tarandeep at gmail.com> wrote:
> Hi,
>
> I am using QT 4.6.1 on Ubuntu Linux.
> I ran ThreadedFortuneServer example. I started multiple clients to talk to
> the server. Each client sends several requests serially.
>
> I found that the memory footprint of ThreadedFortuneServer goes up as more
> and more clients connect (as expected) but it does not come down even when
> clients have disconnected.
> In other words, the more the number of connections the server is handling
> at any given time, the more memory is used but not freed.
>
This is standard memory allocation behaviour for Unix systems.
When a program allocates memory via malloc/new, it may have
to request more virtual memory from the OS, via a system call
(sbrk()). However, when the same program releases memory
via free/delete, the program does not reduce its virtual memory
requirement. So programs generally have monotonically
increasing virtual memory sizes, as reported by VSZ.
That is probably all that you are seeing.
--
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100520/a89b24f5/attachment.html
More information about the Qt-interest-old
mailing list