Re: GDB and scripting languages - which

Jim Blandy
2007-02-14T20:48:47Z

Some rough info on resource consumption. The "VSZ" column says how
much virtual memory the process is consuming, and the "RSS" column
says how much is actually in physical memory at the moment. RSS is a
better indicator of the actual impact a program is having.

In the tests shown here, Python uses about 2.4x as much memory as Lua,
and 4% as much memory as GDB does debugging itself, having set and hit
a breakpoint on main.

I think both Python and Lua's resource consumption is reasonable for
our application.

$ cd ~/uberbaum/build-cvs-out/gdb
$ ./gdb gdb
GNU gdb 6.6.50.20070130-cvs
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
Setting up the environment for debugging gdb.
Breakpoint 1 at 0x8087612: file /home/jimb/uberbaum/cvs-out/gdb/utils.c, line 819.
Breakpoint 2 at 0x80c2ea5: file /home/jimb/uberbaum/cvs-out/gdb/cli/cli-cmds.c, line 201.
(top-gdb) b main
Breakpoint 3 at 0x807eb65: file /home/jimb/uberbaum/cvs-out/gdb/gdb.c, line 30.
(top-gdb) run
Starting program: /home/jimb/uberbaum/build-cvs-out/gdb/gdb

Breakpoint 3, main (argc=
During symbol reading, incomplete CFI data; unspecified registers (e.g., eax) at 0x807eb62.
1, argv=0xbffb2f74) at /home/jimb/uberbaum/cvs-out/gdb/gdb.c:30
30 memset (&args, 0, sizeof args);
(top-gdb) ps uww -C gdb
Undefined command: "ps". Try "help".
(top-gdb) shell ps uww -C gdb
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
jimb 8104 5.7 2.6 59116 54032 pts/2 S+ 12:44 0:00 ./gdb gdb
jimb 8107 0.0 0.0 5208 500 pts/2 T 12:44 0:00 /home/jimb/uberbaum/build-cvs-out/gdb/gdb
(top-gdb) quit
The program is running. Exit anyway? (y or n) y
$ python
Python 2.4.4 (#1, Oct 23 2006, 13:58:00)
[GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
[1]+ Stopped python
$ ps uww -C python
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
jimb 8071 0.0 0.1 6240 2632 pts/2 T 12:41 0:00 python
$ lua
Lua 5.1.1 Copyright (C) 1994-2006 Lua.org, PUC-Rio
>
[2]+ Stopped lua
$ ps uww -C lua
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
jimb 8074 0.0 0.0 4548 1116 pts/2 T 12:41 0:00 lua
$