Re: Bind features
- Posted by Lucius Hilley <lhilley at CDC.NET> Jun 30, 1999
- 667 views
.COM files are completely loaded into memory. You must have more memory than the size of the file to load a .COM file. .EXE files are NOT loaded into memory. The header to a .EXE file is loaded. The header then tells the file offset of the program code and how large that code is. One could write a program, compile it, and then attach a huge bitmap to the end of the program and not effect in any way the amount of the code that is loaded into memory. This means that unused data at the end of a .EXE file won't require more memory for the program to be loaded. Just may Hard Drive space for it to reside. Lucius L. Hilley III lhilley at cdc.net +----------+--------------+--------------+ | Hollow | ICQ: 9638898 | AIM: LLHIII | | Horse +--------------+--------------+ | Software | http://www.cdc.net/~lhilley | +----------+-----------------------------+ > ---------------------- Information from the mail header ----------------------- > Poster: Ralf Nieuwenhuijsen <nieuwen at XS4ALL.NL> > Subject: Re: Bind features > -------------------------------------------------------------------------- ----- > > > 1. After processing a constant declaration, all the data and > > code used in calculating the constants value is freed. e.g. > > > > constant SIZE=10+100-22*foobar({1,2,3,4,5}) > > Robert, wouldn't you above example, not generate 1) the four bytes needed to > store the value *and* 2) the fourthy two bytes to store the code that > calculates the constant. > > I mean: > > constant my_string = "Hello, world" > > Is in the code, in the memory of the interpreter, even before it is > executed. > Therefor it is in memory twice, unlike information loaded from a resource > file. > > > 2. Whether bound or not, the operating system only > > loads the Euphoria interpreter into memory. It is then > > up to Euphoria to open a file (the same .exe file, in the case > > of a bound executable) and read in your Euphoria program. > > As a quick test, I added 40 Mb of garbage onto the end of > > a bound .exe file. It had no effect of the speed of running the > > .exe. Obviously, the operating system was not trying to load > > the 40 Mb of garbage into the 32 Mb of memory on the machine. > > Really ? I can remember all kinds of 'program does not fit in memory' errors > on my old 286. > Trying to free-up conventional memory, unloading device drivers, etc. > It were not errors generated by the program I believe, rather by the OS. > > I trust your word though, it does suprises me. Is the executable information > load-on-demand ? > Which would almost appear as if the OS is interpreting the executable file, > rather than the chipset, which was my guess. > > Ralf N. >