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

Re: Debian shared libs use far more memory than required



Stephane Chauveau wrote:
> Thiemo Seufer wrote:
> 
> >Andreas Barth wrote:
> >[snip]
> > 
> >
> >>>DEBIAN PACKAGE FROM REPOSITORY:
> >>>11 .rodata      000840cb  000000000021a180  000000000021a180   ...
> >>>21 .data         000233c0  00000000003f1d60  00000000003f1d60  ...
> >>>
> >>>MY OWN RECOMPILED DEBIAN PACKAGE:
> >>>11 .rodata       000a43ad  00000000001f3180  00000000001f3180  ...
> >>>21 .data         00000748  00000000003f3460  00000000003f3460  ...
> >>>
> >>>That's 0x0233c0-0x748 = 140KB moved from shared to non-shared
> >>>
> >>>140KB of non shared memory per GTK application is HUGE!!!
> >>>     
> >>>
> >
> >Fortunately it is not as bad as it sounds iff the constant data is
> >collated together in larger chunks. The kernel does copy-on-write,
> >if a .data page is never written, the memory usage is effectively
> >the same.
> > 
> >
> 
> I checked the content of the .data section in libgtk and the
> unexpected data appears to  be composed of all exported
> symbols aligned to a multiple of 16.  Obviously a symbol
> table of some kind.

The whole thing sounds like the result of hiding _GLOBAL_OFFSET_TABLE_
and _PROCEDURE_LINKAGE_TABLE_ in newer binutils.


Thiemo



Reply to: