Re: Memory leaks and regexp

roland.kaufmann@hermes.space.at
Tue, 9 Jun 1998 15:55:08 +0200

On Solaris 2.5.1, both Guile 1.2 and guile-core-19980514 appear to
leak memory in regexp-exec. Below you can see output from ps and
(gc-stats) over time

1. Fresh guile-core-19980514
2. After 10000 calls to regexp-exec
3. After 100000 calls to regexp-exec
4. After (expt 10 6) calls to regexp-exec

USER PID %CPU %MEM SZ RSS TT S START TIME COMMAND
1 kf 8639 10.2 3.8 2968 2380 pts/4 S 15:40:13 0:06 guile
2 kf 8639 0.1 4.4 3340 2780 pts/4 S 15:40:13 0:08 guile
3 kf 8639 27.0 8.9 6164 5604 pts/4 S 15:40:13 0:24 guile
4 kf 8639 1.2 43.43440427480 pts/4 S 15:40:13 3:04 guile

1 ((gc-time-taken . 114)
(cells-allocated . 59683)
(cell-heap-size . 98304) (bytes-malloced . 100081)
(gc-malloc-threshold . 150000)
(cell-heap-segments (428896 . 166752) (1098936 . 574648)))
2 ((gc-time-taken . 164)
(cells-allocated . 26660)
(cell-heap-size . 98304) (bytes-malloced . 339285)
(gc-malloc-threshold . 506290)
(cell-heap-segments (428896 . 166752) (1098936 . 574648)))
3 ((gc-time-taken . 374)
(cells-allocated . 71275)
(cell-heap-size . 98304) (bytes-malloced . 2499278)
(gc-malloc-threshold . 2563150)
(cell-heap-segments (428896 . 166752) (1098936 . 574648)))
4 ((gc-time-taken . 2394)
(cells-allocated . 78698)
(cell-heap-size . 98304) (bytes-malloced . 24099306)
(gc-malloc-threshold . 29196388)
(cell-heap-segments (428896 . 166752) (1098936 . 574648)))

Hope this helps,
Roland