Port-amiga archive

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

Re: Time to fix the memory allocation on port-amiga



On Tue, 21 Dec 2010, John Klos wrote:

> For a while I've written about how a 256 meg Amiga system can't access
> enough memory properly. For the purposes of running a bulk package build,
> I've compiled a kernel for my A1200 which only uses 128 megs. However, now
> it seems that even 128 meg systems are having problems. At various places
> in a build of lang/php53 on a 127 meg Amiga 4000, I'm seeing "virtual
> memory exhausted: Cannot allocate memory" messages.

  How much swap space do you have configured?

> I have to start learning the internals myself if I'm to be useful. Could
> anyone help me get started, either by suggesting some reading materials or
> by suggesting a starting place to figure out where to fix these allocation
> issues? This should be a relatively slow week, and I'd love to get this
> fixed.

  You could start with bulding a kernel with the following options:

option  USRSTACK        0x1E000000
option  MAXDSIZ         (32*1024*1024)
#option MAXSSIZ         (16*1024*1024)

  The USRSTACK value should result in the maximum user address space
useable before the 040/060 pmap limitation would cause system panics.

  The MAXDSIZ is set to the default data size so that all the data segment
memory would be available by default (a non-kernel alternative is to
ulimit -d to 128MB.  The defaults mean there are 96MB of virtual memory
assigned to the data segement that would normally not be available.

  The MAXSSIZ would reduce the maximum stack to 1/2 the current value - if
nothing uses more than 16MB of stack, that could be reduced further (the
default is 2MB).  Stack space is available only for the stack, so there's
30MB of virtual space not available for malloc().

  So on the current kernel, without raising the data 'limit', there is
going to be at least 126MB of virtual memory a process won't use (the 30MB
of stack space, and the 96MB of data space).  There will actually be a bit
more, since the max text size is 6MB, and very few programs will be using
all that space, but it's going to be 'reserved' out of the virtual space
as well.  The MAXTSIZ could possibly be reduced, which would make a few
more MB available.

Mike


Home | Main Index | Thread Index | Old Index