On 03/27/13 07:45, Wenchao Xia wrote:
> Hi, Luiz
>   Personally I hope reduce the dynamic allocated buffer which brings
> fragments and unexpected memory grow.

It's a tradeoff.  We can reduce the dynamic allocation, by simply
reusing the qstring instead of allocation a new one (after
complete/partial write).  At the cost of wasting some memory.

Given that qstrings grow expotentially I think the dynamic allocation
overhead isn't that bad.

> Instead, how about sacrifice
> some time to wait output complete, since monitor is not time critical?

The watch added recently will fire when there is space for writing.
Right now it will write out the next chunk from the buffer.

In theory we could change the monitor code to continue generating the
response when there is more output space, so we don't have to buffer it
in the first place.  But I think the complexity simply isn't worth it
for the memory savings we can gain.

cheers,
  Gerd



Reply via email to