Amd64 ubuntu build hogs memory due to libs built with excessive alignment requirement
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NVIDIA Drivers Ubuntu |
Incomplete
|
Undecided
|
Unassigned | ||
Ubuntu |
Confirmed
|
High
|
Ubuntu AMD64 Porting Team |
Bug Description
I started a thread on this subject on the ubuntu-devel mailing list, but I
figured I should create a bug to track it here. It seems that there are a
number of badly built libraries in the amd64 build that hog tons of memory.
This results in a freshly booted ubuntu desktop system using 500 out of 1000
megs of ram. A number of processes that should be rather small end up using
~100 megs of ram, for instance, on my system, clock-applet uses 111 megs of ram.
I believe that I have found the cause of the problem to be a number of libraries
that, for some reason, were built with a 1 MB alignment requirement, so when
they are mapped into memory, what should be a small 8 KB mapping becomes a 1 MB
mapping. It appears typical that each library gets 2 of these 1 MB mappings in
each process that loads it, and a number of processes are loading ~40 libraries
with this problem, so ~80 megs of ram is being wasted per process.
One example lib has this objdump:
/usr/lib/
/usr/lib/
architecture: i386:x86-64, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x0000000000006310
Program Header:
LOAD off 0x0000000000000000 vaddr 0x0000000000000000 paddr
0x0000000000000000 align 2**20
filesz 0x000000000000cd8c memsz 0x000000000000cd8c flags r-x
LOAD off 0x000000000000d000 vaddr 0x000000000010d000 paddr
0x000000000010d000 align 2**20
filesz 0x00000000000018e0 memsz 0x0000000000001960 flags rw-
DYNAMIC off 0x000000000000d470 vaddr 0x000000000010d470 paddr
0x000000000010d470 align 2**3
filesz 0x0000000000000420 memsz 0x0000000000000420 flags rw-
EH_FRAME off 0x000000000000c094 vaddr 0x000000000000c094 paddr
0x000000000000c094 align 2**2
filesz 0x00000000000002ac memsz 0x00000000000002ac flags r--
STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr
0x0000000000000000 align 2**3
filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-
The 2**20 should be more like 2**3. I'm not sure where/how this package was
built, but it seems it was done wrong, and these packages will all need to be
rebuilt with the correct alignment.
Changed in ubuntu: | |
status: | Invalid → Confirmed |
See http:// lists.ubuntu. com/archives/ ubuntu- devel/2005- October/ 012640. html