Re: Constant STRINGs, PMCs, Garbage Collection, and PBC

2008-02-26 Thread Allison Randal
chromatic wrote: On Sunday 24 February 2008 18:41:23 Bob Rogers wrote: Granted, and it's tough to make a PMC truly read-only until after it's completely initialized . . . There's a similar problem for accessors and setters. Again, that's solveable with more code or more cleverness.

Constant STRINGs, PMCs, Garbage Collection, and PBC

2008-02-24 Thread chromatic
Some of our memory problems seem to be strange interactions between PObjs allocated out of constant pools, garbage collection, and freezing/thawing PBC (not to mention the interaction of HLLs). PObjs allocated out of constant pools persist in memory. They get marked (sometimes, but not always

Re: Constant STRINGs, PMCs, Garbage Collection, and PBC

2008-02-24 Thread Leopold Toetsch
Am Sonntag, 24. Februar 2008 10:55 schrieb chromatic: PMCs that *do* need a special mark() are troublesome; they may contain pointers to non-constant PObjs that *do* need live marking, lest they get swept away during the second half of GC. If these constant PObjs don't get marked, there's a

Re: Constant STRINGs, PMCs, Garbage Collection, and PBC

2008-02-24 Thread chromatic
On Sunday 24 February 2008 07:33:30 Leopold Toetsch wrote: Am Sonntag, 24. Februar 2008 10:55 schrieb chromatic: PMCs that *do* need a special mark() are troublesome; they may contain pointers to non-constant PObjs that *do* need live marking, lest they get swept away during the second

Constant STRINGs, PMCs, Garbage Collection, and PBC

2008-02-24 Thread Bob Rogers
From: chromatic [EMAIL PROTECTED] Date: Sun, 24 Feb 2008 01:55:20 -0800 Some of our memory problems seem to be strange interactions between PObjs allocated out of constant pools, garbage collection, and freezing/thawing PBC (not to mention the interaction of HLLs). Amen

Re: Constant STRINGs, PMCs, Garbage Collection, and PBC

2008-02-24 Thread chromatic
On Sunday 24 February 2008 16:55:48 Bob Rogers wrote: Some of our memory problems seem to be strange interactions between PObjs allocated out of constant pools, garbage collection, and freezing/thawing PBC (not to mention the interaction of HLLs). Amen! -- particularly the strange

Re: Constant STRINGs, PMCs, Garbage Collection, and PBC

2008-02-24 Thread Bob Rogers
From: chromatic [EMAIL PROTECTED] Date: Sun, 24 Feb 2008 17:22:19 -0800 On Sunday 24 February 2008 16:55:48 Bob Rogers wrote: Why do constant PMCs ever need to point to non-constant ones? In other words, why are those pointed-to PObjs not also constant? The reason is

Re: Constant STRINGs, PMCs, Garbage Collection, and PBC

2008-02-24 Thread chromatic
On Sunday 24 February 2008 18:41:23 Bob Rogers wrote: Granted, and it's tough to make a PMC truly read-only until after it's completely initialized . . . There's a similar problem for accessors and setters. Again, that's solveable with more code or more cleverness. So, you're saying

Re: Constant STRINGs, PMCs, Garbage Collection, and PBC

2008-02-24 Thread Bob Rogers
, and then mutable again (but some objects may not allow this, particularly singletons). Immutable objects are not treated specially by garbage collection. (I don't think this is useful to Parrot per se, but may be useful to HLL implementors.) pure -- immune from garbage collection. As a practical matter

[perl #49328] [BUG] problem between PBC loading and garbage collection

2008-01-03 Thread via RT
# New Ticket Created by François PERRAD # Please include the string: [perl #49328] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=49328 I've isolated one problem between PBC loading and garbage collection. (remember

Lua PMC Garbage Collection Segmentation fault

2006-03-05 Thread François PERRAD
Hi all, A Segmentation fault occurs in the languages/lua/t/tables_3.pir. This test is a simple table creation (with 1000 items) : a = {} for i=1,1000 do a[i] = i*2 end print(a[9]) This problem started with revision 11586. In the previous Lua PMC implementation (r11478),

Re: Software Transactional Memory interaction with Garbage Collection

2005-06-04 Thread Leopold Toetsch
Sam Vilain wrote: Hi all, While I must start this post out by saying that I've never implemented either STM or a garbage collector, during a discussion on #parrot (is that channel logged?), a similarity between the two processes occurred to me. Not really. STM is a scheme to handle access

Software Transactional Memory interaction with Garbage Collection

2005-06-03 Thread Sam Vilain
Hi all, While I must start this post out by saying that I've never implemented either STM or a garbage collector, during a discussion on #parrot (is that channel logged?), a similarity between the two processes occurred to me. Would this be an adequate expression of a generational Garbage

Lazy Lists + Mutable Arrays + Garbage Collection

2005-04-24 Thread Brad Bowman
Hi, I've been wondering how to lazy lists will work. The answer Correctly, don't worry about it, is entirely acceptable... The intent of this example in S06 seems clear, make @oddsquares a lazily filled array of squares of odd @nums: S06/Pipe operators It [==] binds the (potentially lazy)

Re: Lazy Lists + Mutable Arrays + Garbage Collection

2005-04-24 Thread Brad Bowman
With cons based lists, past stream values are no longer referred to so can be reclaimed, but we have random access arrays. That's about where my wondering stopped. It started again. @primesquares.shift would do it Brad

Re: More Garbage Collection Issues

2005-03-30 Thread Leopold Toetsch
Nick Glencross [EMAIL PROTECTED] wrote: Ok, now I understand. This is inspecting the C runtime stack (I think). The Interpreter remembers the bottom address, and then when the time comes, a routine runs the depth of the stack. Yes. Exactly. The values on the stack are then checked whether

Re: More Garbage Collection Issues

2005-03-29 Thread Leopold Toetsch
Cory Spencer [EMAIL PROTECTED] wrote: I've come across another garbage collection/DOD issue that I'm trying to solve (without much success) and would appreciate some tips/advice on how to locate the source of the problem. When I'm investigating GC bugs, the usual procedure is like this: - run

Re: More Garbage Collection Issues

2005-03-29 Thread Nick Glencross
Leopold Toetsch wrote: Cory Spencer [EMAIL PROTECTED] wrote: I've come across another garbage collection/DOD issue that I'm trying to solve (without much success) and would appreciate some tips/advice on how to locate the source of the problem. Running valgrind (on supported platforms

Re: More Garbage Collection Issues

2005-03-29 Thread Nick Glencross
Nick Glencross wrote: The DOD certainly has a few things flagged up, which I'm going to quickly investigate to see if they are serious or not... I've learned alot about DOD since earlier (and watched telly). Not as straightforward as I thought it would be to find if these traces should be

Re: More Garbage Collection Issues

2005-03-29 Thread Nick Glencross
Nick Glencross wrote: I've learned alot about DOD since earlier (and watched telly). Not as straightforward as I thought it would be to find if these traces should be considered serious or not (I would say any logic based on unitialised values will bite one day!). Ok, now I understand. This is

Re: Garbage Collection Issues?

2005-03-28 Thread Leopold Toetsch
Cory Spencer [EMAIL PROTECTED] wrote: ---354891615-125901741-966306=:18075 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed I've been writing a Lisp implementation on top of Parrot for the last several months (and I'm just about at the point where I'm ready to unleash it upon

Garbage Collection Issues?

2005-03-27 Thread Cory Spencer
a segmentation fault and on a Mac OS X 10.3 machine produces a bus error. Running with the garbage collection disabled (ie. with the -G flag) does not produce these errors. If anyone could point me towards what is going wrong, I would MOST appreciate it - it's been driving me nuts. (I've been

Re: [perl #31729] [BUG] Garbage collection bug tickled by Tcl?

2004-09-29 Thread Will Coleda
Try again, please. In addition to fixing the incomplete commit below, I've committed the build runtime library with parrot ticket as well, so you'll need to do a re-configure build. On Tue, Sep 28, 2004 at 02:49:45PM +0200, Leopold Toetsch wrote: Will Coleda [EMAIL PROTECTED] wrote:

Re: [perl #31729] [BUG] Garbage collection bug tickled by Tcl?

2004-09-28 Thread Leopold Toetsch
Will Coleda [EMAIL PROTECTED] wrote: oolong:~/research/parrot coke$ ./parrot languages/tcl/tcl.pbc [EMAIL PROTECTED]:~/src/parrot-leo/languages/tcl] $ make make: *** No rule to make target `lib/commands/unset.imc', \ needed by `lib/tcllib.pbc'. Stop. leo

Re: [perl #31729] [BUG] Garbage collection bug tickled by Tcl?

2004-09-28 Thread William Coleda
I don't see my followup that I sent from a different account earlier today. Try this again - you'll need a re-configure as there's a change to the root Makefile that tcl now requires. Thanks for checking into this. Leopold Toetsch wrote: Will Coleda [EMAIL PROTECTED] wrote:

Re: incremental garbage collection 1/2

2004-08-21 Thread Leopold Toetsch
André Pang [EMAIL PROTECTED] wrote: On 21/08/2004, at 5:48 AM, Leopold Toetsch wrote: 3) The copying collector isn't integrated yet. But that should be easy. After finishing sweep and if there is some possible wastage in the memory pools, these get compacted. I thought Parrot wasn't using

Re: incremental garbage collection 1/2

2004-08-21 Thread Leopold Toetsch
objects. That's exactly a mark and sweep garbage collector. DOD is the first phase of that garbage collection. It would be rather useless, if we only detect garbage and not collect it. It's misleading. ... The GC, on the other hand, collects up garbage memory, making the assumption that all

Re: incremental garbage collection 2/2

2004-08-20 Thread Leopold Toetsch
Matt Fowles [EMAIL PROTECTED] wrote: Leo~ Nice summary of the issues, but I have a few nits to pick Thanks. I'll only look at DFS. It more cache-friendly. Thus I don't think that BFS works. Now lets consider DFS of both sets. A refs C,B; B refs D, E; C refs E; D refs G; E refs A Ah,

Re: incremental garbage collection 2/2

2004-08-20 Thread Matt Fowles
Leo~ On Fri, 20 Aug 2004 16:26:33 +0200, Leopold Toetsch [EMAIL PROTECTED] wrote: And yes, I'm really thinking of inserting these A* nodes. Freezing an object does need it. DOD of course not really. How is space going to be made for these? DOD probably does not want to allocate the dummy

incremental garbage collection 1/2

2004-08-20 Thread Leopold Toetsch
[ Oops that one got the wrong address, resent ] Original Message To: perl6-internals-subscribe ... Some remarks 0) Parrot's nomenclature DOD vs GC is a bit misleading. The DOD subsystem is the stop-the-world mark sweep collector that recycles object headers. The GC is the

Re: incremental garbage collection 2/2

2004-08-20 Thread Leopold Toetsch
references in the volatile root set is ignored for garbage collection. For freezing the whole interpreter it would need consideration though. Summary: - the old generation graph is always uptodate - on massive changes to such an old object it's taken out of old - the young generation's graph is created last

Re: incremental garbage collection 1/2

2004-08-20 Thread Dan Sugalski
At 9:48 PM +0200 8/20/04, Leopold Toetsch wrote: 0) Parrot's nomenclature DOD vs GC is a bit misleading. The DOD subsystem is the stop-the-world mark sweep collector that recycles object headers. The GC is the copying collector for variable sized string and other buffer memory. The incremental

Re: incremental garbage collection 1/2

2004-08-20 Thread André Pang
On 21/08/2004, at 5:48 AM, Leopold Toetsch wrote: 3) The copying collector isn't integrated yet. But that should be easy. After finishing sweep and if there is some possible wastage in the memory pools, these get compacted. I thought Parrot wasn't using copying collectors, since you're exposing

Re: incremental garbage collection 1/2

2004-08-20 Thread Luke Palmer
Andr Pang writes: On 21/08/2004, at 5:48 AM, Leopold Toetsch wrote: 3) The copying collector isn't integrated yet. But that should be easy. After finishing sweep and if there is some possible wastage in the memory pools, these get compacted. I thought Parrot wasn't using copying

Richard Jone's: the Garbage Collection Page

2004-04-29 Thread Garrett Goebel
Richard Jones is the author of Garbage Collection: algorithms for automatic dynamic memory management http://www.amazon.com/exec/obidos/tg/detail/-/0471941484. A book that I believe has been mentioned on the list before. I do not believe anyone has mentioned his website: http://www.cs.kent.ac.uk

Re: Garbage Collection Tasks

2003-12-30 Thread Jeff Clites
, and the GC_IS_MALLOC code is already handling the COW cases. #2 is a bit more interesting and, if we do it right, means that we'll end up with a pluggable garbage collection system and may (possibly) be able to have type 3 threads share object arenas and memory pools, which'd be rather nice. Even

Garbage Collection Tasks

2003-12-29 Thread Dan Sugalski
issues when sharing data between interpreters. So, time for some work. The task is twofold: 1) The garbage collection and memory allocation APIs needs to be formalized and abstracted a bit. (We're likely most of the way there, but it's been a while since I've looked and, honestly, the GC/DOD

Re: Garbage Collection Tasks

2003-12-29 Thread Jeff Clites
with a pluggable garbage collection system and may (possibly) be able to have type 3 threads share object arenas and memory pools, which'd be rather nice. Even if not, it leaves a good window for experimentation in allocation and collection, which isn't bad either. This, combined with the mention

Re: Garbage Collection Tasks

2003-12-29 Thread Dan Sugalski
chunk of memory, so freeing up one's not a sufficient reason to return the memory to the free pool. #2 is a bit more interesting and, if we do it right, means that we'll end up with a pluggable garbage collection system and may (possibly) be able to have type 3 threads share object arenas

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-16 Thread Uri Guttman
"TB" == Tim Bunce [EMAIL PROTECTED] writes: TB On Thu, Feb 15, 2001 at 02:26:10PM -0500, Uri Guttman wrote: "TB" == Tim Bunce [EMAIL PROTECTED] writes: TB As a part of that the weak reference concept, bolted recently into TB perl5, could be made more central in perl6. TB

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Branden
Damien Neil wrote: Using object lifetime to control state is almost never a good idea, even if you have deterministic finalization. A much better approach is to have methods which allow holders of the object to control it, and a finalizer (DESTROY method) which cleans up only if necessary.

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Branden
Hong Zhang A deterministic finalization means we shouldn't need to force programmers to have good ideas. Make it easy, remember? :) I don't believe such an algorithm exists, unless you stick with reference count. Either doesn't exist, or is more expensive than refcounting. I guess we

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Tim Bunce
On Thu, Feb 15, 2001 at 08:21:03AM -0300, Branden wrote: Hong Zhang A deterministic finalization means we shouldn't need to force programmers to have good ideas. Make it easy, remember? :) I don't believe such an algorithm exists, unless you stick with reference count. Either

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Branden
Tim Bunce wrote: On Thu, Feb 15, 2001 at 08:21:03AM -0300, Branden wrote: And don't forget that if we stick with refcounting, we should try to find a way to break circular references, too. As a part of that the weak reference concept, bolted recently into perl5, could be made more central

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Damien Neil
On Thu, Feb 15, 2001 at 08:07:39AM -0300, Branden wrote: I think you just said all about why we shouldn't bother giving objects deterministic finalization, and I agree with you. If we explicitly want to free resources (files, database connections), then we explicitly call close. Otherwise, it

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Branden
Damien Neil wrote: On Thu, Feb 15, 2001 at 08:07:39AM -0300, Branden wrote: I think you just said all about why we shouldn't bother giving objects deterministic finalization, and I agree with you. If we explicitly want to free resources (files, database connections), then we explicitly

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Alan Burlison
Branden wrote: Just set autoflush, if you're lazy... And say goodbye to performance... The problem is that you can not only count on $fh's DESTROY being called at the end of the block, you often can't count on it ever happening. Anyway, the file would be flushed and closed... That's

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Alan Burlison
Hong Zhang wrote: This code should NEVER work, period. People will just ask for trouble with this kind of code. Actually I meant to have specified "" as the mode, i.e. append, then what I originally said holds true. This behaviour is predictable and dependable in the current perl

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Hong Zhang
rrent perl implementation. Without the the file will contain just "bar\n". That was not what I meant. Your code already assume the existence of reference counting. It does not work well with any other kind of garbage collection. If you translate the same code into C without putting in t

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Alan Burlison
Hong Zhang wrote: That was not what I meant. Your code already assume the existence of reference counting. It does not work well with any other kind of garbage collection. If you translate the same code into C without putting in the close(), the code will not work at all. Wrong, it does

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Ken Fox
Alan Burlison wrote: I think you'll find that both GC *and* reference counting scheme will require the heay use of mutexes in a MT program. There are several concurrent GC algorithms that don't use mutexes -- but they usually depend on read or write barriers which may be really hard for us to

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Hong Zhang
There are several concurrent GC algorithms that don't use mutexes -- but they usually depend on read or write barriers which may be really hard for us to implement. Making them run well always requires help from the OS memory manager and that would hurt portability. (If we don't have OS

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Ken Fox
Hong Zhang wrote: The memory barriers are always needed on SMP, whatever algorithm we are using. I was just pointing out that barriers are an alternative to mutexes. Ref count certainly would use mutexes instead of barriers. The memory barrier can be easily coded in assembly, or intrinsic

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Dan Sugalski
behaviour is predictable and dependable in the current perl implementation. Without the the file will contain just "bar\n". That was not what I meant. Your code already assume the existence of reference counting. It does not work well with any other kind of garbage collection. If yo

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-15 Thread Dan Sugalski
At 09:13 PM 2/15/2001 -0500, Ken Fox wrote: Hong Zhang wrote: The memory barriers are always needed on SMP, whatever algorithm we are using. I was just pointing out that barriers are an alternative to mutexes. Ref count certainly would use mutexes instead of barriers. Not really they

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Dan Sugalski
At 07:44 PM 2/14/2001 +, Simon Cozens wrote: On Wed, Feb 14, 2001 at 08:32:41PM +0100, [EMAIL PROTECTED] wrote: DESTROY would get called twice, which is VERY BAD. *blink* It is? Why? I grant you it isn't the clearest way of programming, but "VERY BAD"? package

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread abigail
bout to go away. DESTROY might be called around the same time its memory is being reclaimed, but from a language perspective, all this memory dealing is non-existant. DESTROY is a language thing, garbage collection an implementation detail of the run-time, purely necessary because of the limited phys

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Simon Cozens
On Wed, Feb 14, 2001 at 08:32:41PM +0100, [EMAIL PROTECTED] wrote: DESTROY would get called twice, which is VERY BAD. *blink* It is? Why? I grant you it isn't the clearest way of programming, but "VERY BAD"? package NuclearReactor::CoolingRod; sub new {

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Branden
[[ reply goes to -internals ]] OK. Let's clear it up all at once from start. Below is the lifecycle of an object (in Perl). A reference is blessed, and an object is the result of this blessing. During the object's life, several methods of it are called, but independent of which are called, it

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Damien Neil
[trimming distribution to -internals only] On Wed, Feb 14, 2001 at 07:44:53PM +, Simon Cozens wrote: package NuclearReactor::CoolingRod; sub new { Reactor-decrease_core_temperature(); bless {}, shift } sub DESTROY { Reactor-increase_core_temperature(); } A better

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Simon Cozens
On Wed, Feb 14, 2001 at 01:24:34PM -0800, Damien Neil wrote: Using object lifetime to control state is almost never a good idea, even if you have deterministic finalization. A deterministic finalization means we shouldn't need to force programmers to have good ideas. Make it easy, remember?

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Damien Neil
On Thu, Feb 15, 2001 at 12:11:27AM +, Simon Cozens wrote: Using object lifetime to control state is almost never a good idea, even if you have deterministic finalization. A deterministic finalization means we shouldn't need to force programmers to have good ideas. Make it easy,

Re: End-of-scope actions: Garbage collection.

2001-02-14 Thread Tony Olekshy
ject's refcount is 1, or it is found in some sort of sweep, then DESTROY and garbage collection can be considered. Meanwhile, I agree that try/finally (or any similar such explicit exception handling mechanism) is not an appropriate way to talk about GC, more strongly, I think the two mechanisms

Re: Garbage collection

2001-02-12 Thread Bryan C . Warnock
On Sunday 11 February 2001 22:48, Jan Dubois wrote: Doing full GC in this fashion after failed API calls will probably wipe out any performance gain mark-and-sweep has over reference counting. Well, after select failed API calls, not every call. And mark-and-sweep, if that's the GC scheme

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Jan Dubois
to think that using mark-and-sweep for garbage collection will be a performance boost. This may not be the case if objects still need to reference counted. I do wish people would get garbage collection and finalization split in their minds. They are two separate things which can

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Branden
Sam Tregar wrote: On Mon, 12 Feb 2001, Dan Sugalski wrote: Also, the vast majority of perl variables have no finalization attached to them. That's true, but without static typing don't you have to treat them as if they did? At the very least you need to do a "is it an object with a

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Branden
to think that using mark-and-sweep for garbage collection will be a performance boost. This may not be the case if objects still need to reference counted. I do wish people would get garbage collection and finalization split in their minds. They are two separate things which can

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Buddha Buck
At 01:45 PM 02-12-2001 -0300, Branden wrote: I think having both copying-GC and refcounting-GC is a good idea. I may be saying a stupid thing, since I'm not a GC expert, but I think objects that rely on having their destructors called the soonest possible for resource cleanup could use a

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Branden
Buddha Buck wrote: At 01:45 PM 02-12-2001 -0300, Branden wrote: Am I too wrong here? It's... complicated... Agreed. Here's an example of where things could go wrong: sub foo { my $destroyme1 = new SomeClass; my $destroyme2 = new SomeClass; my @processme1;

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Dan Sugalski
do wish people would get garbage collection and finalization split in their minds. They are two separate things which can, and will, be dealt with separately. 2x the penalty, right? Instead of a speed increase we carry the burden of ref-counting in addition to the overhead of an alternate s

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Dan Sugalski
a bad space/time tradeoff. But many people seem to think that using mark-and-sweep for garbage collection will be a performance boost. This may not be the case if objects still need to reference counted. Most perl doesn't use that many objects that live on past what's obvious lexically, at least

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Dan Sugalski
At 09:49 AM 2/12/2001 -0800, Jan Dubois wrote: On Mon, 12 Feb 2001 14:50:44 -0300, "Branden" [EMAIL PROTECTED] wrote: Actually I was thinking something like PMCs ($@%) being copy-GCed and referred objects (new SomeClass) being refcounted. In this case above, every operation would use

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Jan Dubois
On Mon, 12 Feb 2001 14:50:44 -0300, "Branden" [EMAIL PROTECTED] wrote: Actually I was thinking something like PMCs ($@%) being copy-GCed and referred objects (new SomeClass) being refcounted. In this case above, every operation would use refcount's, since they're storing objects in PMCs. What

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Jan Dubois
On Mon, 12 Feb 2001 13:33:52 -0500 (EST), Sam Tregar [EMAIL PROTECTED] wrote: It's reasonably obvious (which is to say "cheap") which variables aren't involved with anything finalizable. Probably a simple bit check and branch. Is that cheap? I guess it must be. Yes, but incrementing the

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Sam Tregar
On Mon, 12 Feb 2001, Dan Sugalski wrote: I think I've heard you state that before. Can you be more specific? What alternate system do you have in mind? Is this just wishful thinking? This isn't just wishful thinking, no. You picked the easy one. Maybe you can get back to the other two

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Jan Dubois
On Mon, 12 Feb 2001 13:29:21 -0500, Dan Sugalski [EMAIL PROTECTED] wrote: At 10:38 AM 2/12/2001 -0500, Sam Tregar wrote: On Mon, 12 Feb 2001, Dan Sugalski wrote: Perl needs some level of tracking for objects with finalization attached to them. Full refcounting isn't required, however. I

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Nicholas Clark
On Mon, Feb 12, 2001 at 01:33:52PM -0500, Sam Tregar wrote: Perhaps. It's not rare in OO Perl which is coincidentally one area in serious need of a speedup. I suppose I'm warped by my own experience - all the code I see every day is filled with references and objects. That's probably not

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Dan Sugalski
At 01:33 PM 2/12/2001 -0500, Sam Tregar wrote: On Mon, 12 Feb 2001, Dan Sugalski wrote: I think I've heard you state that before. Can you be more specific? What alternate system do you have in mind? Is this just wishful thinking? This isn't just wishful thinking, no. You picked the

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Dan Sugalski
At 10:46 AM 2/12/2001 -0800, Jan Dubois wrote: On Mon, 12 Feb 2001 13:29:21 -0500, Dan Sugalski [EMAIL PROTECTED] wrote: At 10:38 AM 2/12/2001 -0500, Sam Tregar wrote: On Mon, 12 Feb 2001, Dan Sugalski wrote: Perl needs some level of tracking for objects with finalization attached to

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Piers Cawley
Dan Sugalski [EMAIL PROTECTED] writes: At 10:38 AM 2/12/2001 -0500, Sam Tregar wrote: On Mon, 12 Feb 2001, Dan Sugalski wrote: Perl needs some level of tracking for objects with finalization attached to them. Full refcounting isn't required, however. I think I've heard you state

Re: End-of-scope actions: Garbage collection.

2001-02-12 Thread Dan Sugalski
At 01:59 PM 2/12/2001 -0700, Tony Olekshy wrote: Dan Sugalski wrote: I do wish people would get garbage collection and finalization split in their minds. They are two separate things which can, and will, be dealt with separately. For the record: THE GARBAGE COLLECTOR WILL HAVE

Re: End-of-scope actions: Garbage collection.

2001-02-12 Thread Tony Olekshy
consideration of the matter of end-of-scope includes not just (1) garbage collection, and (2) DESTROY, but also (3) the matter of end-of-scope operations explicitly requested by the developer, in an explicit order which may or may not be related to GC or DESTROY order, and (4) the matter

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread James Mastros
On Mon, Feb 12, 2001 at 05:33:05PM -0500, Dan Sugalski wrote: package foo; use attrs qw(cleanup_sub); would be nice, but I don't know that he'll go for it. (Though it's the only way I can think of to avoid AUTOLOAD being considered a potential destructor) Fiat? It's pretty hard (for

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-12 Thread Dan Sugalski
At 11:28 PM 2/12/2001 +0100, Robin Berjon wrote: At 15:37 12/02/2001 -0500, Dan Sugalski wrote: It *is* rare in OO perl, though. How many of the variables you use are really, truly in need of finalization? .1 percent? .01 percent? Less? Don't forget that you need to count every scalar in every

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-11 Thread Bryan C . Warnock
e external resources (e.g. file handles or database connections) that are only freed during DESTROY. Postponing DESTROY until an indeterminate time in the future can lead to program failures due to resource exhaustion. But doesn't resource exhaustion usually trigger garbage collection and

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-11 Thread Jan Dubois
resource exhaustion. But doesn't resource exhaustion usually trigger garbage collection and resource reallocation? (Not that this addresses the remainder of your post.) Not necessarily; you would have to implement it that way: When you try to open a file and you don't succeed, you run the garbage col

Re: Garbage collection

2001-02-11 Thread Bryan C . Warnock
, vice the XS code anyway? This scheme would only work if *all* resources including memory and garbage collection are handled by the OS (or at least by a virtual machine like JVM or .NET runtime). But this still doesn't solve the destruction order problem. Well, no. My thought would

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-11 Thread Sam Tregar
On Sun, 11 Feb 2001, Jan Dubois wrote: However, I couldn't solve the problem of "deterministic destruction behavior": Currently Perl will call DESTROY on any object as soon as the last reference to it goes out of scope. This becomes important if the object own scarce external resources

Re: Garbage collection

2001-02-11 Thread Jan Dubois
e anywhere. Doing full GC in this fashion after failed API calls will probably wipe out any performance gain mark-and-sweep has over reference counting. This scheme would only work if *all* resources including memory and garbage collection are handled by the OS (or at least by a virtual machine

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-11 Thread Dan Sugalski
I do wish people would get garbage collection and finalization split in their minds. They are two separate things which can, and will, be dealt with separately. For the record: THE GARBAGE COLLECTOR WILL HAVE NOTHING TO DO WITH FINALIZATION, AND NO PERL OBJECT CODE WILL BE CALLED FOR VARIABLES

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-09 Thread Branden
Dan Sugalski wrote: At 12:06 PM 2/9/2001 -0500, Ken Fox wrote: 2. Work proportional to live data, not total data. This is hard to believe for a C programmer, but good garbage collectors don't have to "free" every allocation -- they just have to preserve the live, or

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-09 Thread Nicholas Clark
On Fri, Feb 09, 2001 at 01:19:36PM -0500, Dan Sugalski wrote: The less memory you chew through the faster your code will probably be (or at least you'll have less overhead). Reuse is generally faster and less resource-intensive than recycling. What's true for tin cans is true for memory.

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-09 Thread Dan Sugalski
At 06:30 PM 2/9/2001 +, Nicholas Clark wrote: On Fri, Feb 09, 2001 at 01:19:36PM -0500, Dan Sugalski wrote: The less memory you chew through the faster your code will probably be (or at least you'll have less overhead). Reuse is generally faster and less resource-intensive than

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-09 Thread Dan Sugalski
up/down by 100% might not even be noticeable. I was thinking of things that may process a lot of data but in small pieces, like the command-line greps and suchlike things. They can take a while on 100M files, but that shouldn't be because they've eaten 200M of RAM in the process... Going to a mo

a garbage collection book

2000-08-30 Thread Jarkko Hietaniemi
Something for the reference shelf: Garbage Collection Algorithms for Automatic Dynamic Memory Management Richard Jones Raphael Lins John Wiley and Sons, 1996 ISBN-0-471-94148-4 Still haven't had time to delve into it but from a quick browse it looks

Re: a garbage collection book

2000-08-30 Thread Uri Guttman
gies) JH Generational Garbage Collection (you know the drill) JH Incremental and Concurrent Garbage Collection (...) JH Garbage Collection for C JH Garbage Collection for C++ JH Cache-Conscious Garbage Collection JH Distributed Garbage Collecion sounds like a bunch of garbage to me. du

Re: a garbage collection book

2000-08-30 Thread Joshua N Pritikin
On Wed, Aug 30, 2000 at 01:15:39PM -0400, [EMAIL PROTECTED] wrote: I didn't realize until I read through parts of this exactly how much time a refcounting GC scheme took. Between that and perl 5's penchant for flattening arrays and hashes (which creates a lot of garbage itself for biggish

Re: a garbage collection book

2000-08-30 Thread Dan Sugalski
On Wed, 30 Aug 2000, Joshua N Pritikin wrote: On Wed, Aug 30, 2000 at 01:15:39PM -0400, [EMAIL PROTECTED] wrote: I didn't realize until I read through parts of this exactly how much time a refcounting GC scheme took. Between that and perl 5's penchant for flattening arrays and hashes