[PATCH] report memory recycled by GC

1 view
Skip to first unread message

Qian Yun

unread,
6:26 AM (5 hours ago) 6:26 AM
to fricas-devel
Current ')set message storage on' can report the total memory
usage, but it can't report the memory recycled by GC.

For a certain computation, there is memory needed by the result,
and memory allocated by temporary objects and can be recycled later.

This stat of "memory recycled by GC" can be a useful indicator,
to tell if the algorithm is memory efficient.

The typical use should be this, do a GC first, then the computation
and a GC after that.

- Qian

(1) -> )set message storage on
(1) -> RECLAIM()$Lisp

(1) ()
Type: SExpression
Storage: 2,249,056 (OT) = 2,249,056 bytes (185,008 bytes
recycled)
(2) -> [x for x in 1..100000]; RECLAIM()$Lisp

(2) ()
Type: SExpression
Storage: 133,589,184 (EV) = 133,589,184 bytes (132,395,504 bytes
recycled)
collect-stat-on-recycled-memory.patch
Reply all
Reply to author
Forward
0 new messages