Re: [libvirt] Leaky virsh?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 05, 2009 at 07:23:36PM -0500, Jim Paris wrote:
> John Levon wrote:
> > 
> > Running virsh with the remote driver (as it always is on Solaris), it
> > leaks pretty heavily:
> 
> Yeah, it seems there is no limit on the size of the readline history,
> so it just grows forever.  Try this?

[snip]

> Date: Thu, 5 Feb 2009 19:21:01 -0500
> Subject: [PATCH] virsh: limit history entries
> 
> Limit the number of readline history entries in virsh, to avoid
> unbounded memory usage.
> ---
>  src/virsh.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/src/virsh.c b/src/virsh.c
> index fd23e9f..e879982 100644
> --- a/src/virsh.c
> +++ b/src/virsh.c
> @@ -6776,6 +6776,9 @@ vshReadlineInit(void)
>  
>      /* Tell the completer that we want a crack first. */
>      rl_attempted_completion_function = vshReadlineCompletion;
> +
> +    /* Limit the total size of the history buffer */
> +    stifle_history(500);
>  }
>  
>  static char *

Thanks, I'd applied this patch.

If anyone is feeling motivated, it could be nice to have virsh load/save 
its history to $HOME/.libvirt/virsh.history between invocations.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]