Subject: Re: [SWIPL] Preliminary question

From: Jan Wielemaker <[email-masked]>
Date: Mon, 7 May 2001 21:00:36 +0200

> Hi. Excuse for my english.
> 
> 1. How can I realize peak amount of memory that prolog occupies while it
> thinking about my question?

There is no way to find out right now.  It is difficult too.  Depending
on the stack limit, the system uses different timing for scheduling 
garbage collection.

> 2. Is there any correlaion between _GXXXXXXXXXXXX reported by tracer(or
> while tracing) and amount of memory mentioned above?

Yip.  A variable named _GXXX is located 4*XXX bytes from the base of the
stack (8*XXX on 64-bit machines, etc.).  See also statistics/2.

> 3. Is there any limitations of prolog answers if I'll try to use it through
> C-interface (suppose answer will be relatively big, how about kilobytes)?

The C-interface poses no additional limits except for available memory.
Except for some conversions to char *, the C-interface doesn't claim
much memory.  Each allocated term_t requires 1 word (4 bytes on 32-bit
machines) on the local stack.

	--- Jan