Igor Schein on Mon, 16 Jun 2003 13:18:57 -0400

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

memory management


I am trying to understand the general concept of memory management in
PARI.  I am aware that pari uses both stack and heap memory, but I'd
like to hear what are strengths and weaknesses of each type of
allocation, and what are the considerations whenever one is chosen
over the other.  My lame perspective is the following:

- Stack memory helps you adopt to the size of physical memory of
machine.  A huge drawback is that you may have a job that has been
running for a long period of time, and when you  run out of stack,
that time has been completely wasted.  To safeguard against that, I
usually start gp (32bit) with the stack size of about 90% of physical memory
of the machine or 2GB, whichever is smaller.
- Heap memory has more flexibility, but can potentially bring a
machine to a halt on large memory jobs by eating up all virtual