
Running virsh with the remote driver (as it always is on Solaris), it leaks pretty heavily: thewhip:~ # yes "start fewfewf" | virsh >/dev/null 2>&1 & [1] 6388 # prstat -c -p 6388 PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 6388 root 10M 6788K sleep 59 0 0:00:02 0.2% virsh/1 Total: 1 processes, 1 lwps, load averages: 0.32, 0.12, 0.06 PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 6388 root 11M 7104K sleep 59 0 0:00:02 0.3% virsh/1 Total: 1 processes, 1 lwps, load averages: 0.34, 0.12, 0.06 PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 6388 root 11M 7160K sleep 59 0 0:00:02 0.3% virsh/1 Total: 1 processes, 1 lwps, load averages: 0.36, 0.13, 0.07 Can you reproduce on Linux anyone? regards john

John Levon wrote:
Running virsh with the remote driver (as it always is on Solaris), it leaks pretty heavily:
thewhip:~ # yes "start fewfewf" | virsh >/dev/null 2>&1 & [1] 6388
# prstat -c -p 6388 PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 6388 root 10M 6788K sleep 59 0 0:00:02 0.2% virsh/1 Total: 1 processes, 1 lwps, load averages: 0.32, 0.12, 0.06 PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 6388 root 11M 7104K sleep 59 0 0:00:02 0.3% virsh/1 Total: 1 processes, 1 lwps, load averages: 0.34, 0.12, 0.06 PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 6388 root 11M 7160K sleep 59 0 0:00:02 0.3% virsh/1 Total: 1 processes, 1 lwps, load averages: 0.36, 0.13, 0.07
Can you reproduce on Linux anyone?
Yeah, it seems there is no limit on the size of the readline history, so it just grows forever. Try this? -jim
From a65339502c996dbeea9b6f3172a6cb8a2669f153 Mon Sep 17 00:00:00 2001 From: Jim Paris <jim@jtan.com> 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 * -- 1.5.6.5

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 :|
participants (3)
-
Daniel P. Berrange
-
Jim Paris
-
John Levon