users-prolog
[Top][All Lists]
Advanced

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

Re: Atom table full


From: Salvador Abreu
Subject: Re: Atom table full
Date: Thu, 17 Apr 2008 08:30:38 +0100


On Apr 16, 2008, at 12:49, JCK wrote:

I have no need for backtracking during this portion of the code and have no need for the data after a loop is completed (it's in mysql). So I guess my question is:

(1) is there anyway of clearing the atoms that won't be used again from table?

not that I know of.

(2) there's nowhere in the loop where a huge number of atoms are created. The only place I can think of there being atoms created is after SQL calls when I'm converting and putting the data into prolog variables. Is there anyone else who's had this problem found a culprit which is known for creating lots of atoms?

The output from SQL queries don't really need to be cast as atoms, considering this is a single-use "throw away" item. What I've been doing (in a PostgreSQL interface) is to use Prolog strings (i.e. lists of small integers) as the representation for SQL query results.

I don't know what are the MySQL interface predicates, but it's probably similar to the approach I use here, which entails using:
        :- foreign(pq_get_data_codes(+integer, +integer, -codes)).

instead of:
        :- foreign(pq_get_data_atom(+integer, +integer, -string)).

(this fetches a column from the SQL output) - the thing is using the "codes" type instead of "string", like this you won't be creating useless atoms.

Regards
--
Salvador Abreu       --  http://www.di.uevora.pt/~spa/
Departamento de Informatica
Universidade de Evora - PORTUGAL






reply via email to

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