gcl-devel
[Top][All Lists]
Advanced

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

[Gcl-devel] Re: RE : [Maxima] Pb with memory on Windows XP


From: Camm Maguire
Subject: [Gcl-devel] Re: RE : [Maxima] Pb with memory on Windows XP
Date: 28 Apr 2005 18:36:15 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!

There should be gbc notifications in the output -- have they been
accidentally cut?

In any case, for some reason (which the maxima people might best
answer), your maxima as opposed to your lisp code is allocating a
bunch of strings.  As the default string page allocation is small,
GCL's default strategy is to rebalance the page types based on the
frequency of actual usage.  More string pages are allotted until the
other page types trigger their fair share of gc's.  This statistical
estimation stabilizes after a relatively short while.  The reduction
in gc time is *very* significant.

If one wants the most compact image possible, at the expense of more
gc time, do

:lisp (setq si::*optimize-maximum-pages* nil)

You can read about this flag in the GCL docs.

Here is my illustration:

=============================================================================
(%i1) :lisp (setq si::*optimize-maximum-pages* nil)

NIL
(%i1) :lisp (setq si::*notify-gbc* t) :lisp (room)T

  2495/2495   36.8%         CONS RATIO LONG-FLOAT COMPLEX STRUCTURE
   100/100     3.3%         FIXNUM SHORT-FLOAT CHARACTER RANDOM-STATE READTABLE 
SPICE
   200/200    90.4%         SYMBOL STREAM
     1/2      29.5%         PACKAGE
   100/100    50.5%         ARRAY HASH-TABLE VECTOR BIT-VECTOR PATHNAME 
CCLOSURE CLOSURE
   200/200    34.7%         STRING
   400/400     3.4%         CFUN BIGNUM
    35/101    84.7%         SFUN GFUN VFUN AFUN CFDATA

  1793/2559                 contiguous (775 blocks)
       12926                hole
       400     1.3%         relocatable

      3531 pages for cells
     18650 total pages
    106423 pages available
      5999 pages in heap but not gc'd + pages needed for gc marking
    131072 maximum pages
T
(%i1) for i:1 thru 200000 do (nterms(0));

[SGC for 165 STRING pages..(4698 writable)..(T=3).GC finished]
[SGC for 165 STRING pages..(4698 writable)..(T=3).GC finished]
[SGC for 165 STRING pages..(4698 writable)..(T=2).GC finished]
[SGC for 165 STRING pages..(4698 writable)..(T=2).GC finished]
[SGC for 165 STRING pages..(4698 writable)..(T=3).GC finished]
[SGC for 165 STRING pages..(4698 writable)..(T=2).GC finished]
[SGC for 165 STRING pages..(4698 writable)..(T=3).GC finished]
[SGC for 165 STRING pages..(4698 writable)..(T=3).GC finished]
(%o1)                                DONE
(%i2) :lisp (room)

  2495/2495   66.5%         CONS RATIO LONG-FLOAT COMPLEX STRUCTURE
   100/100    55.3%         FIXNUM SHORT-FLOAT CHARACTER RANDOM-STATE READTABLE 
SPICE
   200/200    90.5%         SYMBOL STREAM
     1/2      29.5%         PACKAGE
   100/100    49.9%         ARRAY HASH-TABLE VECTOR BIT-VECTOR PATHNAME 
CCLOSURE CLOSURE
   200/200    69.7%       8 STRING
   400/400     3.4%         CFUN BIGNUM
    35/101    84.7%         SFUN GFUN VFUN AFUN CFDATA

  1793/2559                 contiguous (776 blocks)
       12926                hole
       400    50.7%         relocatable

      3531 pages for cells
     18650 total pages
    106423 pages available
      5999 pages in heap but not gc'd + pages needed for gc marking
    131072 maximum pages
(%i2) :lisp (setq si::*optimize-maximum-pages* t)

T
(%i2) for i:1 thru 200000 do (nterms(0));

[SGC for 165 STRING pages..(4702 writable)..(T=2).GC finished]
[SGC for 100 FIXNUM pages..(4710 writable)..(T=2).GC finished]
[SGC for 100 FIXNUM pages..(4710 writable)..(T=3).GC finished]
[SGC for 1806 CONS pages..(4742 writable)..(T=2).GC finished]
[SGC for 1806 CONS pages..(4742 writable)..(T=2).GC finished]
[SGC for 1806 CONS pages..(4742 writable)..(T=2).GC finished]
[SGC for 0 RELOCATABLE-BLOCKS pages..(5031 writable)..(T=3).GC finished]
(%o2)                                DONE
(%i3) :lisp (room)

  2741/3755   81.4%       3 CONS RATIO LONG-FLOAT COMPLEX STRUCTURE
   130/658    73.4%       2 FIXNUM SHORT-FLOAT CHARACTER RANDOM-STATE READTABLE 
SPICE
   200/200    90.5%         SYMBOL STREAM
     1/2      29.5%         PACKAGE
   100/100    49.9%         ARRAY HASH-TABLE VECTOR BIT-VECTOR PATHNAME 
CCLOSURE CLOSURE
   253/2313   78.9%       9 STRING
   400/400     3.4%         CFUN BIGNUM
    35/101    84.7%         SFUN GFUN VFUN AFUN CFDATA

  1793/2559                 contiguous (776 blocks)
       12597                hole
       400     6.5%       1 relocatable

      3860 pages for cells
     18650 total pages
    106423 pages available
      5999 pages in heap but not gc'd + pages needed for gc marking
    131072 maximum pages
(%i3) 
=============================================================================

Take care,

"laurent couraud" <address@hidden> writes:

> Greetings!
> 
> Following the Maxima session.
> 
> Maxima 5.9.1 http://maxima.sourceforge.net
> Using Lisp Kyoto Common Lisp GCL 2.6.5 (aka GCL)
> Distributed under the GNU Public License. See the file COPYING.
> Dedicated to the memory of William Schelter.
> This is a development version of Maxima. The function bug_report()
> provides bug reporting information.
> (%i1) :lisp (setq si::*notify-gbc* t) :lisp (room)T
>   1921/1921   47.3%         CONS RATIO COMPLEX STRUCTURE
>    100/100     2.9%         FIXNUM SHORT-FLOAT CHARACTER RANDOM-STATE 
> READTABLE NIL
>    200/200    90.5%         SYMBOL STREAM
>      1/2      29.5%         PACKAGE
>    109/109    46.4%         ARRAY HASH-TABLE VECTOR BIT-VECTOR PATHNAME 
> CCLOSURE FAT-STRING
>    200/200    33.7%         STRING
>    400/400     5.0%         CFUN BIGNUM LONG-FLOAT
>     30/115    98.8%         SFUN GFUN CFDATA SPICE NIL
> 
>   1036/1441                 contiguous (583 blocks)
>        12879                hole
>        400     1.8%         relocatable
> 
>       2961 pages for cells
>      17276 total pages
>     109026 pages available
>       4770 pages in heap but not gc'd + pages needed for gc marking
>     131072 maximum pages
> for i:1 thru 200000 do (nterms(0));(%o1)
> DONE
> (%i2) :lisp (room)
>   2988/2988   35.4%       4 CONS RATIO COMPLEX STRUCTURE
>    151/401     8.7%       2 FIXNUM SHORT-FLOAT CHARACTER RANDOM-STATE 
> READTABLE NIL
>    200/200    90.5%         SYMBOL STREAM
>      1/2      29.5%         PACKAGE
>    109/109    45.9%         ARRAY HASH-TABLE VECTOR BIT-VECTOR PATHNAME 
> CCLOSURE FAT-STRING
>    278/598    26.7%       2 STRING
>    400/400     5.0%         CFUN BIGNUM LONG-FLOAT
>     30/115    98.8%         SFUN GFUN CFDATA SPICE NIL
> 
>   1036/1441                 contiguous (583 blocks)
>        11683                hole
>        400    50.6%         relocatable
> 
>       4157 pages for cells
>      17276 total pages
>     109026 pages available
>       4770 pages in heap but not gc'd + pages needed for gc marking
>     131072 maximum pages
> 
> After that I tried to write a lisp file like this:
> 
>       ;;; -*- Mode: Lisp; package:maxima; syntax:common-lisp ;Base: 10 -*- ;;;
> 
>       (in-package "MAXIMA")
>       ;;** Variable settings were **
> 
>       ;;TRANSCOMPILE:TRUE;
>       ;;TR_SEMICOMPILE:FALSE;
>       ;;TRANSLATE_FAST_ARRAYS:TRUE;
>       ;;TR_WARN_UNDECLARED:COMPILE;
>       ;;TR_WARN_MEVAL:COMPFILE;
>       ;;TR_WARN_FEXPR:COMPFILE;
>       ;;TR_WARN_MODE:ALL;
>       ;;TR_WARN_UNDEFINED_VARIABLE:ALL;
>       ;;TR_FUNCTION_CALL_DEFAULT:GENERAL;
>       ;;TR_ARRAY_AS_REF:TRUE;
>       ;;TR_NUMER:FALSE;
>       ;;DEFINE_VARIABLE:FALSE;
> 
>       (setq si::*notify-gbc* t)
>       (room)
>       (DO ((|$i| 1 (F+ 1 |$i|))) ((> |$i| 200000) '$DONE)
>         (MFUNCTION-CALL $NTERMS 0))
>       (room)
> 
> And the result of loading it is:
> 
> (%i1) load("test.lisp");
> 
>   1921/1921   47.3%         CONS RATIO COMPLEX STRUCTURE
>    100/100     2.9%         FIXNUM SHORT-FLOAT CHARACTER RANDOM-STATE 
> READTABLE NIL
>    200/200    90.5%         SYMBOL STREAM
>      1/2      29.5%         PACKAGE
>    109/109    46.4%         ARRAY HASH-TABLE VECTOR BIT-VECTOR PATHNAME 
> CCLOSURE FAT-STRING
>    200/200    33.7%         STRING
>    400/400     5.0%         CFUN BIGNUM LONG-FLOAT
>     30/115    98.8%         SFUN GFUN CFDATA SPICE NIL
> 
>   1036/1441                 contiguous (582 blocks)
>        12879                hole
>        400     1.8%         relocatable
> 
>       2961 pages for cells
>      17276 total pages
>     109026 pages available
>       4770 pages in heap but not gc'd + pages needed for gc marking
>     131072 maximum pages
> 
>   2883/3531   35.8%       4 CONS RATIO COMPLEX STRUCTURE
>    225/631     8.6%       2 FIXNUM SHORT-FLOAT CHARACTER RANDOM-STATE 
> READTABLE NIL
>    200/200    90.4%         SYMBOL STREAM
>      1/2      29.5%         PACKAGE
>    109/109    45.9%         ARRAY HASH-TABLE VECTOR BIT-VECTOR PATHNAME 
> CCLOSURE FAT-STRING
>    200/200    27.8%         STRING
>    400/400     5.0%         CFUN BIGNUM LONG-FLOAT
>     30/115    98.8%         SFUN GFUN CFDATA SPICE NIL
> 
>   1036/1441                 contiguous (582 blocks)
>        11792                hole
>        400     1.8%         relocatable
> 
>       4048 pages for cells
>      17276 total pages
>     109026 pages available
>       4770 pages in heap but not gc'd + pages needed for gc marking
>     131072 maximum pages
> 
> And finally I tried this lisp file:
> 
>       (in-package "MAXIMA")
> 
>       (room)
>       (DO ((|$i| 1 (F+ 1 |$i|))) ((> |$i| 2000) '$DONE)
>         (MFUNCTION-CALL $NTERMS 0))
>       (gbc t)
>       (room)
> 
> And the result of loading it is (the best):
> 
> (%i1) load("d:/math/superzoom/test.lisp");
> 
>   1921/1921   47.3%         CONS RATIO COMPLEX STRUCTURE
>    100/100     2.9%         FIXNUM SHORT-FLOAT CHARACTER RANDOM-STATE 
> READTABLE NIL
>    200/200    90.5%         SYMBOL STREAM
>      1/2      29.5%         PACKAGE
>    109/109    46.4%         ARRAY HASH-TABLE VECTOR BIT-VECTOR PATHNAME 
> CCLOSURE FAT-STRING
>    200/200    33.7%         STRING
>    400/400     5.0%         CFUN BIGNUM LONG-FLOAT
>     30/115    98.8%         SFUN GFUN CFDATA SPICE NIL
> 
>   1036/1441                 contiguous (582 blocks)
>        12879                hole
>        400     1.8%         relocatable
> 
>       2961 pages for cells
>      17276 total pages
>     109026 pages available
>       4770 pages in heap but not gc'd + pages needed for gc marking
>     131072 maximum pages
> 
>   1921/1921   45.9%         CONS RATIO COMPLEX STRUCTURE
>    100/100     2.7%         FIXNUM SHORT-FLOAT CHARACTER RANDOM-STATE 
> READTABLE NIL
>    200/200    90.4%         SYMBOL STREAM
>      1/2      29.5%         PACKAGE
>    109/109    45.9%         ARRAY HASH-TABLE VECTOR BIT-VECTOR PATHNAME 
> CCLOSURE FAT-STRING
>    200/200    27.8%         STRING
>    400/400     5.0%         CFUN BIGNUM LONG-FLOAT
>     30/115    98.8%         SFUN GFUN CFDATA SPICE NIL
> 
>   1036/1441               1 contiguous (582 blocks)
>        12879                hole
>        400     0.2%         relocatable
> 
>       2961 pages for cells
>      17276 total pages
>     109026 pages available
>       4770 pages in heap but not gc'd + pages needed for gc marking
>     131072 maximum pages
> 
> if I must include this lisp command in many point in my translated code it's 
> hard.
> In particular because apparently it is not possible to include a lisp command 
> in a batch file.
> 
> 
> Laurent
> 
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

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