[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] Monitor: Make output buffer dynamic
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] Monitor: Make output buffer dynamic |
Date: |
Tue, 02 Apr 2013 11:18:43 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130307 Thunderbird/17.0.3 |
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH 2/2] Monitor: Make output buffer dynamic,
Gerd Hoffmann <=