From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,4cd9428d3407c70e X-Google-Attributes: gidfee84,public From: Bill James Subject: Re: Linker virtual size Date: 1998/09/18 Message-ID: <36028475.ABD@lsl.co.uk>#1/1 X-Deja-AN: 392444261 Content-Transfer-Encoding: 7bit References: <35FE6050.19A1@lsl.co.uk> <35FE9048.794B@zk3.dec.com> <35FEB41B.EE58A65A@brighttiger.com> Content-Type: text/plain; charset=us-ascii Organization: Laser-Scan Ltd. Mime-Version: 1.0 Newsgroups: comp.unix.osf.osf1 Jeff Denham wrote: > > Joe Mario wrote: > > > Bill James wrote: > > > I guess lots/all of us suffer from this - we customarily get VS over > > > 300Mb and sometimes 400Mb while linking our 35Mb executable. 128Mb > > > machine unusable during this period. > > > > > > Why is it so big??? > > > > The amount of memory used by ld during a link is primarily a function of > > the > > number and size of the input objects and the number of external > > symbols in those objects. Other things come into play but to a smaller > > degree. The resultant size of the executable says nothing about what > > the linker was dealing with for inputs. > > In other words, ld is essentially mmap()-ing the whole > shooting match -- .o's and referenced .a and .so -- > into its address space. This makes it much more efficient > in terms of its I/O behavior, but as you're seen, can > result in a huge VM footprint. > I've noticed that it is tolerant of running out of swap space - you get messages saying 'cannot allocate requested swap' or some such. I guess that it starts dealing in I/O when that happens - perhaps I can constrain it using 'limit'... no, just tried limit addressspace and it died horribly... think again... Bill -- Bill James (mailto:bill@lsl.co.uk) Laser-Scan Ltd, Systems Development Manager Science Park, Milton Rd, Tel: 01223 420414 Fax: 01223 420044 Cambridge, CB4 4FY, UK. = Any opinions expressed are mine and not necessarily Laser-Scan's =