Gerry Reno wrote:
> When I look at upstream 20061020-3:
> MEMSIZE="`head -1 /proc/meminfo | awk '{ print $2 }'`"
> looks like it still might be high by a factor of 1024 since MEMSIZE is in megabytes and meminfo is in kilobytes.
>
> That is why my patch adjusted for the difference:
> MEMSIZE=$(($(cat /proc/meminfo | awk '/^MemTotal/ { print $2 }') / 1024))
Indeed. Probably got through unnoticed because of the reintroduction
of a maximum size. Thanks for spotting that.
It's though fixed in the current upstream developement snapshot:
MEMTOTAL="`grep '^MemTotal:' /proc/meminfo | awk '{ print $2 }'`"
# make MBytes which rounded down will be about 10 too few, so add 10
MEMSIZE="`echo "${MEMTOTAL} 1024 / 10 + p q" | dc`"
# compute desired swap size, as factor * RAM
CONF_SWAPSIZE="`echo "${MEMSIZE} ${CONF_SWAPFACTOR} * p q" | dc`"
# remove any fractional MBytes
CONF_SWAPSIZE="`echo "${CONF_SWAPSIZE}" | cut -f 1 -d '.'`"
Hi,
Gerry Reno wrote:
> When I look at upstream 20061020-3:
> MEMSIZE="`head -1 /proc/meminfo | awk '{ print $2 }'`"
> looks like it still might be high by a factor of 1024 since MEMSIZE is in megabytes and meminfo is in kilobytes.
>
> That is why my patch adjusted for the difference:
> MEMSIZE=$(($(cat /proc/meminfo | awk '/^MemTotal/ { print $2 }') / 1024))
Indeed. Probably got through unnoticed because of the reintroduction
of a maximum size. Thanks for spotting that.
It's though fixed in the current upstream developement snapshot:
MEMTOTAL= "`grep '^MemTotal:' /proc/meminfo | awk '{ print $2 }'`" "`echo "${MEMTOTAL} 1024 / 10 + p q" | dc`" SWAPSIZE= "`echo "${MEMSIZE} ${CONF_SWAPFACTOR} * p q" | dc`" SWAPSIZE= "`echo "${CONF_SWAPSIZE}" | cut -f 1 -d '.'`"
# make MBytes which rounded down will be about 10 too few, so add 10
MEMSIZE=
# compute desired swap size, as factor * RAM
CONF_
# remove any fractional MBytes
CONF_
Regards, Axel people. debian. org/~abe/
--
,''`. | Axel Beckert <email address hidden>, http://
: :' : | Debian Developer, ftp.ch.debian.org Admin
`. `' | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE
`- | 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5