Run out of memory under WIN95

new topic     » topic index » view thread      » older message » newer message

On June 28, Rob Craig answered:

>[...]
>I typed in this quick example of what you seem to be doing and it
>ran ok for me under windows 3.1 with an 8Mb RAM machine.
>It generated a 1.5 Mb "junk.dat" file.
>I will try it later on a win95 machine. Maybe you can post some of
>your code so we can see more precisely what you are doing.
>[...]


Rob, Thanks for the explanation and example code.
Here follows some code of the program which ran out of memory at
the moment it read in the entire list. EX was running in a DOS-box in
WIN95.

----------- start of mycode -----------------------
-- 29/05/96
-- modified 01/07/96: translated
-- small testprogram to examine the write time for print(fnum,list)
-- for a given list with structure {{n,n},{n,n},{..,..}}.

include sort.e
include get.e
include machine.e

constant EXAMPLES = 100000  -- number of keys in list
constant SCREEN = 1         -- standard output
atom     t0, t1             -- time
sequence list               -- list of numbers
integer  fnum               -- file handle number

--with trace
--trace(1)

-- create empty list
list = {}

-- fill the list with random numbers
puts(SCREEN,"Fill the list with random numbers.\n")
t0 = time()
for i = 1 to EXAMPLES do
    list = append(list,{rand(1000000),i}) -- structure {{n,n},{n,n}}
end for
t1 = time()
printf(SCREEN,"Time to create the list: %f\n",t1-t0)

-- sort the list on key-field
puts(SCREEN,"Sorting.\n")
t0 = time()
list = sort(list)
t1 = time()
printf(SCREEN,"Sorting time: %f\n",t1-t0)

-- write list to file in structure {{...},{...}}
puts(SCREEN,"Writing the list to file list.ind.\n")
fnum = open("list.ind","wb")
t0 = time()
print(fnum,list)
t1 = time()
printf(SCREEN,"Writing time: %f\n",t1-t0)
close(fnum)

-- make the list empty
list = {}

-- Read the list from disk
puts(SCREEN,"Read the list from disk.\n")
fnum = open("list.ind","rb")
t0   = time()
list = get(fnum)
t1   = time()
printf(SCREEN,"Time to read the list: %f\n",t1-t0)
close(fnum)
------------- end of mycode --------------------


To overcome temporary the problem:
I've changed the MS-DOS "settings" (I don't know how it is
called in English because I've a Dutch version) to "Pure MS-DOS",
WIN95 is closed and all what remains is good old 'new-95-MS-DOS'.
The program runs fine and at EXIT Windows starts all over again.

To get the same possibility as DOS/Windows 3.11 I changed in the
hidden systemfile MSDOS.SYS the parameter BootGUI = 1 to
BootGUI = 0 so WIN95 wil not start up and will stop after loading
AUTOEXEC.BAT. Be careful, MSDOS.SYS attribs must remain RHS after
editing. If you want to go to Windows type "WIN".

Regards,
   Marcel Kollenaar

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu