home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.vms
- Path: sparky!uunet!paladin.american.edu!gatech!darwin.sura.net!haven.umd.edu!decuac!pa.dec.com!nntpd2.cxo.dec.com!adserv.enet.dec.com!winalski
- From: winalski@adserv.enet.dec.com (Paul S. Winalski)
- Subject: Re: ballooning EXE size
- Message-ID: <1992Dec30.221028.25252@nntpd2.cxo.dec.com>
- Lines: 45
- Sender: usenet@nntpd2.cxo.dec.com (USENET News System)
- Reply-To: winalski@adserv.enet.dec.com (Paul S. Winalski)
- Organization: Digital Equipment Corporation, Nashua NH
- References: <01GSUT89O7JK000J0I@XRT.UPENN.EDU> <1992Dec29.111631.1@slacvx.slac.stanford.edu>
- Date: Wed, 30 Dec 1992 22:10:28 GMT
-
-
- In article <1992Dec29.111631.1@slacvx.slac.stanford.edu>,
- fairfield@slacvx.slac.stanford.edu writes:
-
- [regarding the problem of a FORTRAN program that suddenly needed 70 times
- as many disk blocks for the .EXE after minor changes and a relink]
- |>
- |> You haven't told us what you're doing in "my code". If your code was
- |> Fortran (which I take it, it is not), and if you declared local
- |> arrays, and if you initialized _any_portion_ of those arrays to
- |> non-zero values, then you would get the behaviour you've described.
- |> If you're writing in C, and the arrays are static, and you initialize
- |> any portion of them to non-zero values, I would expect the same
- |> situation.
- |>
- |> Reason: the VMS linker normally will not allocate blocks in the disk
- |> file (.EXE file) for uninitialized memory. These are referred to as
- |> "demand zero pages". Only when the image is activated is virtual
- |> memory allocated for such memory. However, if you initialize a
- |> portion of an array, the linker is prevented from using demand-zero
- |> pages and the whole, initialized array is expanded in the .EXE file.
-
- Not true. Initialization of a portion of an array doesn't cause the whole
- array to be written to blocks in the disk file. The Linker lays out memory for
- all program sections in the image, then it fills in the initial values for
- the code and initialized data, and then it scans the image looking for
- uninitialized pages. Where it finds a run of uninitialized pages, it creates
- a new image section with the demand-zero attribute. Demand-zero pages don't
- have to appear in the .EXE file, since by definition the system knows that they
- are all zeros. This phase of the link is called "demand-zero compression".
-
- Image sections do not come for free. Your process can only have a certain
- number of them, given by the PROCSECTCNT SYSGEN parameter value. To avoid
- creating too many image sections, the Linker stops doing demand-zero compression
- when the total number of image sections reaches the value set by the ISD_MAX
- linker option, the default value of which is 96. This is what happened to the
- original poster. His program has lots of little runs of uninitialized pages
- in it. Something that he changed pushed the Linker over the ISD_MAX limit and
- it stopped creating demand-zero image sections. One or more large,
- uninitialized arrays that occur in the image after that point thus weren't
- dzero-compressed and ended up on disk.
-
- Steve Lionel's posting gave the solutions to this problem.
-
- --PSW
-