[Spice-devel] [PATCH 1/2] Release more drawables on OOM

Uri Lublin uril at redhat.com
Mon Sep 20 04:34:00 PDT 2010


On 09/09/2010 07:56 PM, alexl at redhat.com wrote:
> From: Alexander Larsson<alexl at redhat.com>
>
> We've changed how resources are released so they are now being
> freed continuosly, rather than on OOM, since we want to free as early
> possible to avoid fragmentation. So, OOM situations should be a bit
> less common now and signify a real memory shortage, so we should try
> to free up more resources.
> ---
>   server/red_worker.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/server/red_worker.c b/server/red_worker.c
> index 74d26fe..b9f9fc5 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -4412,7 +4412,7 @@ static int red_process_commands(RedWorker *worker, uint32_t max_pipe_size, int *
>       return n;
>   }
>
> -#define RED_RELEASE_BUNCH_SIZE 5
> +#define RED_RELEASE_BUNCH_SIZE 64
>
>   static void red_free_some(RedWorker *worker)
>   {

It would be nice to use profiling tools to better understand the affect of such 
changes (maybe a small task for the interested reader).
If it takes "too long" to free many resources, it may affect user experience.
Since we (as users) haven't seen it affecting our user experience,

Ack.


More information about the Spice-devel mailing list