users-prolog
[Top][All Lists]
Advanced

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

Very small size limit of Gnu Prolog "database"?


From: Mark Roulo
Subject: Very small size limit of Gnu Prolog "database"?
Date: Tue, 11 Dec 2012 10:49:26 -0800 (PST)

I am exploring the size limits for GNU Prolog
when used as a database.  Right now I have
a prolog file that contains 10,000 simple facts.

It looks like this:

    is_a_widget('GUID:Widget-0000000').
    is_a_widget('GUID:Widget-0000001').
    is_a_widget('GUID:Widget-0000002').
          :
          :
    is_a_widget('GUID:Widget-0009995').
    is_a_widget('GUID:Widget-0009996').
    is_a_widget('GUID:Widget-0009997').
    is_a_widget('GUID:Widget-0009998').
    is_a_widget('GUID:Widget-0009999').

The GNU Prolog compiler chokes when trying to compile it.

    xyzzy:Src kt$ gplc -o program blatz.pl

    Fatal Error: global stack overflow (size: 32768 Kb, reached: 32765 Kb,
    environment variable used: GLOBALSZ) compilation failed

Increasing the GLOBALSZ variable to 300MB doesn't help:

    xyzzy:Src kt$ GLOBALSZ=327650; export GLOBALSZ; gplc -o program blatz.pl

    Fatal Error: global stack overflow (size: 327652 Kb, reached: 327649 Kb,
    environment variable used: GLOBALSZ) compilation failed

Is 10,000 facts a *REAL* limit?  Or am I doing something very wrong?  Ideally
I'd like to go to about 1,000,000 simple facts.

I created my input prolog file with this C program:

    #include <stdio.h>

    int main(int argc, char *argv[])
    {
        FILE *fp = fopen(argv[1], "w");

        for (int i = 0; i < 10000; ++i)
        {
            fprintf(fp, "is_a_widget('GUID:Widget-%07d').\n", i);
        }

        fclose(fp);

        return 0;
    }

Thanks,
    Mark Roulo

reply via email to

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