gmp vs mp ?



J?rgen Tischer wrote:

> On Tuesday 16 October 2001 12:04, you wrote:
>
> > So, to make GCL 2.4.0 with gmp run really fast one need
> > to make init.lsp which looks something like this
> > (progn
> >   (si::allocate 'cons 20000 t)
> >   (si::allocate 'fixnum 4000 t)
> >   (si::allocate-relocatable-pages 10000 t)
> >   (si::allocate 'cfun 5000 t)
> >   (si::set-gmp-allocate-relocatable t)
> > )
>
> I did it but couldn't bring it to work. Below the message.
>
>    jt@Bachue:~$ maxima
>    GCL (GNU Common Lisp)  Version(2.4.0) Tue Sep 18 17:52:18 EDT 2001
>    Licensed under GNU Library General Public License
>    Contains Enhancements by W. Schelter
>    Loading init.lsp
>
>    Error: Can't set the limit for relocatable blocks to 7500.
>    Fast links are on: do (si::use-fast-links nil) for debugging
>    Error signalled by SYSTEM:ALLOCATE-RELOCATABLE-PAGES.
>    Broken at SYSTEM:ALLOCATE-RELOCATABLE-PAGES.  Type :H for Help.
>
> Of course it's about the amount of memory it needs, I can bring it to run
> with less pages. The thing that bothers me is that I have 512 M RAM. When I
> start, top says
>
>     09:35:10 up  1:58,  1 user,  load average: 0.00, 0.04, 0.02
>    52 processes: 50 sleeping, 2 running, 0 zombie, 0 stopped
>    CPU states:   0.0% user,   0.2% system,   0.0% nice,  99.8% idle
>    Mem:    513624K total,   367752K used,   145872K free,    33120K buffers
>    Swap:   513936K total,        0K used,   513936K free,   141600K cached
>
> but this memory is mostly used by kde, so it should be freed up, shouldn't
> it? Any idea?
>
> J?rgen

This is another memory-related feature of GCL. Maximal number of
memory
pages which GCL can allocate is the compilation time parameter
and
as far as I understand it can't be changed later at run time.
By default the limit is 32*1024 pages which amounts to 128Mb of 
RAM
with 4Kb page. I decided that this limit is too restrictive and
recompiled
Maxima with 64*1024. But init.lsp I posted allocates ~140Mb
and I did not noticed that this is above usual RAM limit.
I'm sorry for deceiving audience by bad example but
you can decrease numbers in your init.lsp accordingly.
Do not consider amount of pages allocated in this sample init.lsp
as anything like "optimal choice". In particular, it seems that
with
gmp portion of RAM allocated to cfun may be increased.
If you place
  (setq  si::*notify-gbc*  t)
into init.lsp then GCL will print short message upon each garbage
collection.
An important piece of information here is - which particular
memory type
causes garbage collection. If say cfun causes GC too frequently
then increase
preallocated space for cfun etc...

Vadim

--

[ Vadim V. Zhytnikov  <vvzhy@mail.ru>  <vvzhy@td.lpi.ac.ru> ]