richardm@cogs.susx.ac.uk (Richard Matthias) writes:
> Date: 1 Nov 1995 17:54:23 GMT
> Organization: University of Sussex
in response to Liam Parnell:
> : Dear all,
>
> : I am considering installing the Linux Poplog system, but;
> : What is the memory limit?
> : I may need rather a lot, as I am running Genetic Algorithms,
> : It is possible I might need all the available memory.
[RM]
> I tried it last night and doing:
>
> popmemlim =>;
> 200000
>
> I assume that means (roughly) 200k.
As Ian Rogers explained that's 200,000 machine words, i.e. on a 32
bit machine that means 800,000 bytes, or about 0.75 Mbytes.
What Popmemlim controls is not the total size of your process, but
the amount of space available in the heap, for user-defined
procedures and data structures. There will be quite a lot of extra
space taken up by the Poplog core system, plus the saved image which
includes xved, the poplog user interface stuff, and other things in
the pop11 saved image. The prolog, lisp and ml saved images will
each be bigger.
If you want to know whether your program will run in the free Linux
poplog where popmemlim is fixed at 200000, you can try the following
in a full poplog (if you have access to one, as Liam does):
200000 -> popmemlim;
then try to compile your files and run your program. If it works,
then it should work under Linux pop11. (The procedures compiled on a
risc machine, like a sparc, or sgi, or HP-PA, or DEC Alpha, will
typically take up more space than on linux running on Intel
hardware, so even if your program doesn't quite fit into 200000
words on a sparc, say, it may just squeeze into linux poplog.
For more information on how your heap space gets used up, the
following may be useful:
Each Pop-11 pointer takes up a word. A Pop-11 list is made up of
list links (pairs) containing
(a) one word that points to the word "key" (used for run time
identification of the structure as a list link),
(b) one word for the head of the list (the front of the pair)
(c) one word for the tail of the list (the back of the pair).
Thus in 200,000 words of memory you could store a list of about
round(200000/3) = 66667
items.
Just to compare:
A list of N items takes 3*N words
An ordinary vector of N items takes N words for the items, plus one
word for the vector key and one for an integer saying how many
elements the vector has.
A string of N characters is a vector of N bytes, and that takes
approximately N/4 words (rounded up to the next integer), plus
two words, one for the pointer to the string key, and one for
the size of the of the string.
Other structures created by user programs, e.g. arrays, properties,
procedures, also take up space in the heap. In particular, each VED
buffer is a vector of strings (one string per line). This means that
if you edit long files in VED (including reading online
documentation) that can limit the amount of free space available
within the bounds of popmemlim. You can avoid that by running a
separate poplog process for your editing, saving the files, and then
compiling them from the process in which you are running your
program.
If you run two poplog processes on the same machine they should
share quite a lot of memory, so it's not quite as wasteful as you
might think.
See the following files for more information:
HELP POPMEMLIM
Warning: this gives an out of date value for the default
value of popmemlim. It's no longer 100000.
REF DATA
REF SYSTEM (Section 10 is on Store management)
This says the default popmemlim is normally 300000, but of
course that's wrong for the free version of linux poplog
REF PROCEDURE
This also tells you about pop_callstack_lim, which limits
another part of memory, used for the procedure calling
stack. I don't know if this has an upper bound in the free
version of linux poplog. Possibly not.
Aaron
---
--
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs )
School of Computer Science, The University of Birmingham, B15 2TT, England
EMAIL A.Sloman@cs.bham.ac.uk
Phone: +44-121-414-4775 (Sec 3711) Fax: +44-121-414-4281
|