Re: sbrk() broken?
- From: Ulrich Lauther <ulrich.lauther@xxxxxxxxxxx>
- Date: Thu, 4 Jan 2007 14:12:18 +0000 (UTC)
David Schwartz <davids@xxxxxxxxxxxxx> wrote:
: Ulrich Lauther wrote:
: > However, on another host:
: >
: > Linux imhotep 2.6.5-7.139-smp #1 SMP Fri Jan 14 15:41:33 UTC 2005 x86_64
: > x86_64 x86_64 GNU/Linux
: >
: > I get
: >
: > first 0x806d000 last 0x55553000 diff 1.208 GByte n 316647
: >
: > though this host has got 8 GByte of RAM and 4 GByte of swap
: >
: > (the program above was compiled Cand linked with -m32) and I was the only
: > active user.
: >
: > ulimit -a shows no limitations.
: >
: > Any idea, what's going on?
: The 'brk' system call, which is what you are ultimately calling,
: allocates contiguous virtual memory. My bet is that for some reason
: there is only 1.2GB of contiguous virtual memory available to that
: process, perhaps because of calls (direct or indirect to 'mmap').
: It may help to modify the program to output the contents of
: '/proc/self/maps' when the 'sbrk' fails.
I did this and processed the output to show the size of free memeory
ranges, assuming that this is indicated by a "0" in column 6.
This gives:
08048000-08049000 r-xp 00000000 00:1a 108330 /home/lauther/turbo/test/test
08049000-0804a000 rwxp 00000000 00:1a 108330 /home/lauther/turbo/test/test
0804a000-55554000 rwxp 0804a000 00:00 0
free range 1297129472 Bytes 1.208 GByte
55555000-5556b000 r-xp 00000000 38:05 586380 /lib/ld-2.3.3.so
5556b000-5556c000 rwxp 00016000 38:05 586380 /lib/ld-2.3.3.so
5556c000-5556d000 rwxp 5556c000 00:00 0
free range 4096 Bytes 0.000 GByte
5556d000-55659000 r-xp 00000000 00:1a 253432 /home/lauther/turbo/lib_linux_x86_32_dyn_r_g++/libturbo.so
55659000-55685000 rwxp 000ec000 00:1a 253432 /home/lauther/turbo/lib_linux_x86_32_dyn_r_g++/libturbo.so
55685000-55687000 rwxp 55685000 00:00 0
free range 8192 Bytes 0.000 GByte
556a0000-55798000 r-xp 00000000 38:05 720984 /usr/X11R6/lib/libX11.so.6.2
55798000-5579c000 rwxp 000f7000 38:05 720984 /usr/X11R6/lib/libX11.so.6.2
5579c000-55868000 r-xp 00000000 38:05 704498 /usr/lib/libtk8.4.so
55868000-55874000 rwxp 000cb000 38:05 704498 /usr/lib/libtk8.4.so
55874000-55875000 rwxp 55874000 00:00 0
free range 4096 Bytes 0.000 GByte
55875000-55911000 r-xp 00000000 38:05 704219 /usr/lib/libtcl8.4.so
55911000-5591b000 rwxp 0009c000 38:05 704219 /usr/lib/libtcl8.4.so
5591b000-5591d000 rwxp 5591b000 00:00 0
free range 8192 Bytes 0.000 GByte
5591d000-5591f000 r-xp 00000000 38:05 586389 /lib/libdl.so.2
5591f000-55920000 rwxp 00002000 38:05 586389 /lib/libdl.so.2
55920000-559dd000 r-xp 00000000 00:19 4005872 /sw/gcc4.0.2/lib/libstdc++.so.6.0.6
559dd000-559f5000 rwxp 000bc000 00:19 4005872 /sw/gcc4.0.2/lib/libstdc++.so.6.0.6
559f5000-559fb000 rwxp 559f5000 00:00 0
free range 24576 Bytes 0.000 GByte
559fb000-55a1c000 r-xp 00000000 38:05 586406 /lib/tls/libm.so.6
55a1c000-55a1d000 rwxp 00020000 38:05 586406 /lib/tls/libm.so.6
55a1d000-55a27000 r-xp 00000000 00:19 4005868 /sw/gcc4.0.2/lib/libgcc_s.so.1
55a27000-55a28000 rwxp 00009000 00:19 4005868 /sw/gcc4.0.2/lib/libgcc_s.so.1
55a28000-55b32000 r-xp 00000000 38:05 586405 /lib/tls/libc.so.6
55b32000-55b3a000 rwxp 00109000 38:05 586405 /lib/tls/libc.so.6
55b3a000-55b3d000 rwxp 55b3a000 00:00 0
free range 12288 Bytes 0.000 GByte
55b3d000-55b4d000 r-xp 00000000 00:17 3216114 /sw/local/lib/libz.so.1.2.1
55b4d000-55b4e000 rwxp 0000f000 00:17 3216114 /sw/local/lib/libz.so.1.2.1
55b4e000-55b4f000 rwxp 55b4e000 00:00 0
free range 4096 Bytes 0.000 GByte
55b4f000-55b5e000 r-xp 00000000 38:05 704142 /usr/lib/libbz2.so.1.0.0
55b5e000-55b5f000 rwxp 0000f000 38:05 704142 /usr/lib/libbz2.so.1.0.0
55b5f000-55b60000 rwxp 55b5f000 00:00 0
free range 4096 Bytes 0.000 GByte
ffffb000-ffffd000 rwxp ffffb000 00:00 0
free range 8192 Bytes 0.000 GByte
ffffd000-ffffe000 rw-p ffffd000 00:00 0
free range 4096 Bytes 0.000 GByte
ffffe000-fffff000 ---p 00000000 00:00 0
free range 4096 Bytes 0.000 GByte
: DS
So 1.2 GByte is the largest free range.
However, I have got 8 GByte of RAM and 4 GByte should be addressable in
32-bit mode.
The processor is a AMD Opteron(tm) Processor 252.
On my notebook, where things work as expected, I got an Intel T2300
processor and CONFIG_HIGHMEM4G=y.
I don't see such a parameter on the Opteron host. Is this feature there
missing?
And what's going on below 08048000 ?
Thanks for listening,
-ulrich
[nosave]
----------------------------------------------------------------------------
Ulrich Lauther ph: +49 89 636 48834 fx: ... 636 42284
Siemens CT SE 6 Internet: Ulrich.Lauther@xxxxxxxxxxx
.
- Follow-Ups:
- Re: sbrk() broken?
- From: John Reiser
- Re: sbrk() broken?
- From: David Schwartz
- Re: sbrk() broken?
- References:
- sbrk() broken?
- From: Ulrich Lauther
- Re: sbrk() broken?
- From: David Schwartz
- sbrk() broken?
- Prev by Date: syslog.h
- Next by Date: Re: sbrk() broken?
- Previous by thread: Re: sbrk() broken?
- Next by thread: Re: sbrk() broken?
- Index(es):