1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-24 15:04:13 +00:00
cde/src/cmd/ksh93/data
Martijn Dekker bf79131f40 Use vmstate for memory leak regress tests (re: ad9a9219)
'ps' does not always give reliable results; on macOS, 'ps' appears
to produce nondeterministic (i.e. randomly varying) results for
'vsz' and 'rss', making it unusable for memory leak tests. See:
https://github.com/ksh93/ksh/pull/64#issuecomment-655094931
and further comments.

So let's compile in the vmstate builtin so that we can make sure to
measure things properly. It also reports bytes instead of 1024-byte
blocks, so smaller leaks can be detected.

To be decided: whether or not to disable the vmstate builtin for
release builds in order to save about 12K in the ksh binary.

src/cmd/ksh93/data/builtins.c:
- Add vmstate to the list of builtins that are compiled in.

src/cmd/ksh93/tests/leaks.sh:
- getmem(): get size using: vmstate --format='%(busy_size)u'
  (Using busy_size instead of size seems to make more sense as it
  excludes freed blocks. See vmstate --man)
- Introduce a $unit variable for reporting leaks and set it to
  'bytes'; this makes it easier to change the unit in future.
- Since the tests are now more sensitive, initialise all variables
  before use to avoid false leak detections.
- The last test seemed to need a few more 'read' invocations in
  order to get memory usage to a steady state before the test.
2020-07-08 23:23:19 +01:00
..
aliases.c Make 'stop' and 'suspend' regular built-ins 2020-06-22 15:36:29 +02:00
bash_pre_rc.sh Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
builtins.c Use vmstate for memory leak regress tests (re: ad9a9219) 2020-07-08 23:23:19 +01:00
keywords.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
lexstates.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
limits.c Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
math.tab Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
msg.c Make 'stop' and 'suspend' regular built-ins 2020-06-22 15:36:29 +02:00
options.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
signals.c Fix 'kill -INFO' on systems that support SIGINFO (#59) 2020-07-04 15:57:47 +01:00
strdata.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
testops.c Remove code related to long-dead 3DFS research project 2020-06-12 01:45:17 +02:00
variables.c Fix unreliable behavior when special vars are readonly or unset (#27) 2020-06-20 18:08:41 +01:00