home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!usenet.ins.cwru.edu!agate!ucbvax!lrw.com!leichter
- From: leichter@lrw.com (Jerry Leichter)
- Newsgroups: comp.os.vms
- Subject: RE: ballooning EXE size
- Message-ID: <9212291417.AA07008@uu3.psi.com>
- Date: 29 Dec 92 13:16:44 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Distribution: world
- Organization: The Internet
- Lines: 65
-
-
- I have a problem with the size of an executable going from ~1,000
- blocks to something on the order of 75,000 blocks.
-
- What am I doing? I am charged with writing a small interface to some
- existing FORTRAN code. I have no control over the existing FORTRAN
- code and can only say that it makes extensive use of VAX-FORTRAN
- Structure/record/map statements. I don't own the large body of
- FORTRAN code and really don't relish the thought of rewriting it...
-
- When the FORTRAN interface stub subroutines (e.g. subroutines that
- print a "not implemented" message and return) are replaced with my
- code, the resulting executable goes from ~1,000blocks to ~75,000
- blocks.
-
- Yes, I use some scratch arrays (scratch arrays defined as local to the
- subroutine), so I replaced these with LIB$GET_VM and LIB$FREE_VM and
- the executable size when back to ~1,100 blocks. I presume the
- difference is due to my code size. Ok so far, but I can't get away
- with this for long....
-
- Eventually, the addition of the simplest code causes the executable to
- go from 1,100 blocks to ~76,000 blocks. Looking at the LINK map, the
- size of my interface modules are quite small. Remember, this is
- FORTRAN and most of the memory is statically allocated.
-
- It would seem that I'm crossing some kind of boundary in terms of
- virtual memory usage and am reserving space in the executable file.
- This is merely a hunch and I'd like to query info-vax for an
- explanation and any possible solutions. Yes, I use all the sharable
- portions of FORTRAN and C (there is some C in my interface, but I
- observe the same behavior when the C routines are "dummied" out) as
- follows:
-
- $link/map/exec=foo.exe
- untouchable.olb/INC=foo_main, - ! main calling routine
- untouchable.olb/L, - ! library of untouchable code objects
- expm.olb/l, - ! my interface routines
- sys$input/opt
- SYS$SHARE:FORRTL.EXE/SHARE,sys$library:vaxcrtl.exe/share
-
- Thoughts?
-
- You're running into a classic VMS "gotcha'". All your uninitiallized COMMON
- blocks, as well as any other uninitialized data objects (like arrays that
- aren't on the stack - I'm not sure when VAX FORTRAN decides to put stuff on
- the stack) can appear in the image file as either a page of all zeroes, or as
- a request for a demand-zero section. The Linker does "demand zero compres-
- sion" to locate groups of all-zero pages and convert them to demand-zero
- sections, which take up insignificant space in the executable image. However,
- each demand-zero section requires an Image Section Descriptor (ISD). There
- Linker has a limit, ISD_MAX, on the number of ISD's it is willing to create;
- once it reaches the limit, it just fills the image with zeroed blocks.
-
- ISD_MAX can be changed with a linker option of the same name. By default, it
- equals "approximately 96". Try adding:
-
- ISD_MAX=150
-
- to your Linker options file (the stuff after the LINK command above).
-
- Further details can be found in the Linker manual's chapter on options files.
-
- -- Jerry
-
-