do I have to garbageCollect every time I create a large object?
Bob Arning
arning at charm.net
Thu Aug 9 14:01:10 UTC 2001
Carlos, Stephen, et. al.,
It isn't so much that incremental garbage collection is running more often as it is that it takes a lot longer. The newly allocated large object is in young space and gets scanned during each incremental gc. Doing a garbage collect moves it to old space where it will be, hopefully, scanned much less often. If you look at help/vm statistics, you'll see the difference:
-- before allocating a 4M entry array:
Since last view 240 (88ms between GCs)
uptime 21.2s
full 0 totalling 0ms (0.0% uptime)
incr 240 totalling 541ms (3.0% uptime), avg 2.0ms
tenures 0
-- after allocating a 4M entry array:
Since last view 356 (92ms between GCs)
uptime 32.8s
full 0 totalling 0ms (0.0% uptime)
incr 356 totalling 2,161ms (7.0% uptime), avg 6.0ms
tenures 1 (avg 356 GCs/tenure)
Each incremental is taking 3 times as long, but is happening at the same rate.
Cheers,
Bob
On Thu, 9 Aug 2001 09:12:58 -0400 "Stephen Pair" <spair at advantive.com> wrote:
>I've noticed the same thing as well...
>
>Does incremental GC get triggered based on the size of new space? It
>seems like incremental GC constantly thinks that it needs to run when
>you allocate a huge object. Looks like the big object has to make it
>into old space before things starting working well again.
>
>- Stephen
>
>> -----Original Message-----
>> From: squeak-dev-admin at lists.squeakfoundation.org
>> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On
>> Behalf Of Carlos Sarraute
>> Sent: Wednesday, August 08, 2001 8:18 PM
>> To: squeak-dev at lists.squeakfoundation.org
>> Subject: do I have to garbageCollect every time I create a
>> large object?
>>
>>
>> Hello,
>>
>> I have noticed something curious: after creating a very large
>> object (Array new: 25000000 which ocupies 100.000.000 bytes
>> of memory), everything gets very slow, and the SystemMonitor
>> indicates constant incremental garbage collections. It is
>> only after performing a full garbage collection (Smalltalk
>> garbageCollect) that I can work again normally. My question
>> is: do I have to do "Smalltalk garbageCollect" every time I
>> create a large object? Or are there other ways to handle this
>> situation?
More information about the Squeak-dev
mailing list
|