From: Juneho Yi
Subject: Garbage Collectior "gc" in Lucid Common lisp
Date: 
Message-ID: <1992Mar27.023910.14470@noose.ecn.purdue.edu>
I have a question about the garbage collector(gc function) for
those using **** Lucid Common lisp ******.  I appreciate your replies
to my internet address.

Garbage collection(gc) should eliminate inaccessible objects
from the dynamic space. However, arrays defined inside "let"
is not garbage collected though they are inaccessible after
defined. 
In short, what I did is as follows.

1) (room t)       ;   to check the space in the beginning
2) (let ((a (make-array '(512 512))))
      (setf (aref a 256 256) 1)
      t)
3) (room t)
4) (gc)           ;   to collect garbage in the current dynamic space.
5) (room t)       ;   to see whether the array "a" is garbage-collected or not.

The array, "a" is generated in dynamic-0-area and it is not
garbage-collected after (gc). It shoud be garbage-collected by (gc)
because it is not accessible anymore. Instead of garbage-collecting, 
the whole thing in the dynamic-0-area is copied into the dynamic-1
area. 
what can I do in order to claim the space occupied by the array, "a" ?
The following is the Lucid session.
Thank you.

- -- ยทยท@ecn.purdue.edu

=============================================================================
> (room t)
;;; 756 words [3024 bytes] of dynamic storage in use.
;;; 457738 words [1830952 bytes] of free storage available before a GC.
;;; 916232 words [3664928 bytes] of free storage available if GC is disabled.
;;; Semi-space Size: 1792K bytes [28 segments]
;;; Current Dynamic Area: Dynamic-0-Area
;;; GC Status: Enabled
;;; Reserved Free Space: 4096K bytes [64 segments]
;;; Memory Growth Limit: 70400K bytes [1100 segments], total
;;; Memory Growth Rate: 256K bytes [4 segments]
;;; Reclamation Ratio: 33% desired free after garbage collection
;;; Area Information: 
;;; Name                        Size [used/allocated]
;;; ----                        ----
;;; Ephemeral Level 0           44K/512K bytes,    1/8 segments
;;; Ephemeral Level 1           0K/640K bytes,     0/10 segments
;;; Ephemeral Level 2           0K/640K bytes,     0/10 segments
;;; Ephemeral Odd-level OSP     0K/512K bytes,     0/8 segments
;;; Ephemeral Even-level OSP    0K/640K bytes,     0/10 segments
;;; Dynamic-0-Area              3K/1791K bytes,    1/28 segments
;;; Dynamic-1-Area              0K/1792K bytes,    0/28 segments
;;; Discardable-Static-Area     9K/64K bytes,      1/1 segment
;;; Discardable-Read-Write-Area 608K/640K bytes,   10/10 segments
;;; Foreign Area                41K/64K bytes,     1/1 segment
;;; Static-Area                 2014K/2048K bytes, 32/32 segments
;;; Read-Write-Area             619K/640K bytes,   10/10 segments
;;; Readonly-Pointer-Area       1726K/1728K bytes, 27/27 segments
;;; Readonly-Non-Pointer-Area   7160K/7168K bytes, 112/112 segments
NIL
> (let ((a (make-array '(512 512))))
    (setf (aref a 256 256) 1)
    t)
T
> (room t)
;;; 262902 words [1051608 bytes] of dynamic storage in use.
;;; 195592 words [782368 bytes] of free storage available before a GC.
;;; 654086 words [2616344 bytes] of free storage available if GC is disabled.
;;; Semi-space Size: 1792K bytes [28 segments]
;;; Current Dynamic Area: Dynamic-0-Area
;;; GC Status: Enabled
;;; Reserved Free Space: 4096K bytes [64 segments]
;;; Memory Growth Limit: 70400K bytes [1100 segments], total
;;; Memory Growth Rate: 256K bytes [4 segments]
;;; Reclamation Ratio: 33% desired free after garbage collection
;;; Area Information: 
;;; Name                        Size [used/allocated]
;;; ----                        ----
;;; Ephemeral Level 0           49K/512K bytes,    1/8 segments
;;; Ephemeral Level 1           0K/640K bytes,     0/10 segments
;;; Ephemeral Level 2           0K/640K bytes,     0/10 segments
;;; Ephemeral Odd-level OSP     0K/512K bytes,     0/8 segments
;;; Ephemeral Even-level OSP    0K/640K bytes,     0/10 segments
;;; Dynamic-0-Area              1027K/1791K bytes, 17/28 segments
;;; Dynamic-1-Area              0K/1792K bytes,    0/28 segments
;;; Discardable-Static-Area     9K/64K bytes,      1/1 segment
;;; Discardable-Read-Write-Area 608K/640K bytes,   10/10 segments
;;; Foreign Area                41K/64K bytes,     1/1 segment
;;; Static-Area                 2014K/2048K bytes, 32/32 segments
;;; Read-Write-Area             619K/640K bytes,   10/10 segments
;;; Readonly-Pointer-Area       1726K/1728K bytes, 27/27 segments
;;; Readonly-Non-Pointer-Area   7160K/7168K bytes, 112/112 segments
NIL
> (gc)

;;; GC: 262714 words [1050856 bytes] of dynamic storage in use.
;;; 196036 words [784144 bytes] of free storage available before a GC.
;;; 654786 words [2619144 bytes] of free storage available if GC is disabled.
1051016
782960
2616936
> (room t)
;;; 262754 words [1051016 bytes] of dynamic storage in use.
;;; 195740 words [782960 bytes] of free storage available before a GC.
;;; 654234 words [2616936 bytes] of free storage available if GC is disabled.
;;; Semi-space Size: 1792K bytes [28 segments]
;;; Current Dynamic Area: Dynamic-1-Area
;;; GC Status: Enabled
;;; Reserved Free Space: 4096K bytes [64 segments]
;;; Memory Growth Limit: 70400K bytes [1100 segments], total
;;; Memory Growth Rate: 256K bytes [4 segments]
;;; Reclamation Ratio: 33% desired free after garbage collection
;;; Area Information: 
;;; Name                        Size [used/allocated]
;;; ----                        ----
;;; Ephemeral Level 0           50K/512K bytes,    1/8 segments
;;; Ephemeral Level 1           0K/640K bytes,     0/10 segments
;;; Ephemeral Level 2           0K/640K bytes,     0/10 segments
;;; Ephemeral Odd-level OSP     0K/512K bytes,     0/8 segments
;;; Ephemeral Even-level OSP    0K/640K bytes,     0/10 segments
;;; Dynamic-0-Area              0K/1792K bytes,    0/28 segments
;;; Dynamic-1-Area              1027K/1791K bytes, 17/28 segments
;;; Discardable-Static-Area     9K/64K bytes,      1/1 segment
;;; Discardable-Read-Write-Area 608K/640K bytes,   10/10 segments
;;; Foreign Area                41K/64K bytes,     1/1 segment
;;; Static-Area                 2014K/2048K bytes, 32/32 segments
;;; Read-Write-Area             619K/640K bytes,   10/10 segments
;;; Readonly-Pointer-Area       1726K/1728K bytes, 27/27 segments
;;; Readonly-Non-Pointer-Area   7160K/7168K bytes, 112/112 segments
NIL
>











------- End of Forwarded Message