do I have to garbageCollect every time I create a large object?

Stephen Pair spair at advantive.com
Thu Aug 9 14:09:24 UTC 2001


So, how can this be improved?  Should substantially large objects be
allocated in old space to begin with?  Then you wouldn't be able to
release them without a full GC.  Should incremental GC check the size of
young space, and if substantially large, automatically invoke a full GC
(this would seem problematic as machines become faster...i.e. what was
too large last year may not be a problem on today's hardware)?

Since allocating and deallocating huge objects is probably not something
that will be done frequently, the current situation may be acceptable
(just create the new object and do a full gc or two).  But, it seems
like there should be some way to make incremental GC quickly determine
that a large object should be moved to old space (perhaps without
needing a full GC).

- Stephen

> -----Original Message-----
> From: Bob Arning [mailto:arning at charm.net] 
> Sent: Thursday, August 09, 2001 10:01 AM
> To: spair at advantive.com; squeak-dev at lists.squeakfoundation.org
> Subject: Re: RE: do I have to garbageCollect every time I 
> create a large object?
> 
> 
> 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