users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: garbage collection


From: Gregory Bourassa
Subject: Re: garbage collection
Date: Tue, 17 Feb 2004 10:16:33 -0500 (EST)

Mike,

You likely do not need anything special for the parser portion of your program, 
as it is 
unlikely to be memory-intensive.

Prolog is generally stack-oriented, so a garbage collecter usually makes sense 
only for 
the global heap area, if any.

Interestingly, your reference to "rather trivial code to read in words from the 
input" 
reminds me that string I/O goes on the global heap in Visual Prolog -- and 
there is stays 
until you backtrack past the I/O call.    Gnu Prolog may have a similar 
behaviour; I 
don't know for sure.  You need to be particularly careful of I/O code where 
garbage is 
concerned.

Regards.

Gregory Bourassa

On Feb 17, "Mike Maxwell" <address@hidden> wrote:
> 
> I need to port an app from "Visual Prolog" (I know, that's why I'm porting
> it).  One of the guidelines is that the source code needs to remain hidden,
> hence I want a true compiler.  (I'm assuming that a "byte code" compiler
> will allow you to dump the source code via the debugger.)
> 
> Gnu-Prolog seems a logical (pun intended) choice.  However, it apparently
> doesn't have a garbage collector (yet).  It's unclear to me how much of a
> problem this is.
> 
> I could probably find out whether it's a problem by finishing the port and
> then trying out the application.  But I'd rather not potentially waste time
> doing that, if it's not going to work.  So--
> 
> (1) Am I correct that Gnu Prolog doesn't have gc?
> 
> (2) How much of a problem is this in practice?  What kind of programming
> constructs lead to running out of memory?
> 
> (3) There's a snippet of code on page 85 of O'Keefe's "The Craft of Prolog"
> which claims to be a work-around for systems without gc.  But I'm unfamiliar
> with how Prologs work internally, and it's unclear to me whether this will
> necessarily work with GnuProlog.  (I assume it will, O'Keefe certainly knows
> what he's talking about, and GC implements the standard WAM, but...)  The
> app I'm porting is fairly shallow--it's a morphological parser, so it's
> doing a shallow search repeatedly.  I very much doubt it would run out of
> memory parsing a single word.  So it looks like it would be easy to wrap the
> call to parse a single word in this, and I would be home free, apart from
> the rather trivial code to read in words from the input.  Does this make
> sense?
> 
>     Mike Maxwell
>     LDC
>     address@hidden
> 
> 
> 
> _______________________________________________
> Users-prolog mailing list
> address@hidden
> <a href='http://mail.gnu.org/mailman/listinfo/users-
prolog'>http://mail.gnu.org/mailman/listinfo/users-prolog</a>
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]