Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!CIM-VAX.HONEYWELL.COM!derstad From: derstad@CIM-VAX.HONEYWELL.COM ("DAVE ERSTAD") Newsgroups: comp.sys.apollo Subject: Re: memory allocation bug Message-ID: <8912120119.AA22888@umix.cc.umich.edu> Date: 11 Dec 89 20:28:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 120 I've received a request for the test program which demonstrates the alleged memory allocation bug in SR10.1 The program is given below, along with some results. The point at which SR10 breaks down appears to be somewhat variable, and I haven't tried to find out what causes that variability. It always breaks, though. We've verified this at SR10.1, SR10.1.1, and SR10.1.p. BTW, the results below are with -opt 0 to prevent anything from being optimized away. SR9.7.0.4 SR10.1.1 DN4000 16.0 MB memory DN4500 32.0 MB memory 170MB disk 380 MB FA disk Alloc speed - alloc 1 7.4 Alloc speed - alloc 1 1.5 Alloc speed - alloc 2 12.8 Alloc speed - alloc 2 2.5 Alloc speed - alloc 3 10.3 Alloc speed - alloc 3 3.4 Alloc speed - alloc 4 9.8 Alloc speed - alloc 4 3.0 Alloc speed - alloc 5 7.4 Alloc speed - alloc 5 3.0 Alloc speed - alloc 6 7.4 Alloc speed - alloc 6 3.4 Alloc speed - alloc 7 8.4 Alloc speed - alloc 7 3.9 Alloc speed - alloc 8 10.8 Alloc speed - alloc 8 4.4 Alloc speed - alloc 9 9.8 Alloc speed - alloc 9 4.4 Alloc speed - alloc 10 7.9 Alloc speed - alloc 10 5.4 Alloc speed - alloc 11 10.8 Alloc speed - alloc 11 51.7 Alloc speed - alloc 12 10.3 ( The next one is > 600 - I killed it ) Alloc speed - alloc 13 8.4 Alloc speed - alloc 14 12.3 Alloc speed - alloc 15 9.4 Alloc speed - alloc 16 9.8 Alloc speed - alloc 17 9.8 Alloc speed - alloc 18 8.4 Alloc speed - alloc 19 8.9 Alloc speed - alloc 20 8.9 Dave Erstad DERSTAD@cim-vax.honeywell.com -------------------------------------------------------------------- program test; %nolist; %include '/sys/ins/base.ins.pas'; %include '/sys/ins/cal.ins.pas'; %list; type onek = array[1..256] of integer32; const size = 2000 { kb}; max_alloc = 20; var ar : array[1..size] of ^onek; num_alloc : integer; (*************************************************************) (* *) (* Real_seconds Function Integer32 *) (* *) (* Determines the number of real-time seconds since *) (* midnight. *) (* *) (*************************************************************) function real_seconds : integer32; var temp_rec : cal_$timedate_rec_t; begin (* real_seconds *) cal_$decode_local_time(temp_rec); with temp_rec do real_seconds := hour * 3600+minute*60+second; end (* real_seconds *); (*************************************************************) (* *) (* Alloc Procedure *) (* *) (* Allocate (size) items, each about 1k byte. Touch *) (* each data time. *) (* *) (*************************************************************) procedure alloc; var i, j, r1, r2 : integer32; begin r1 := real_seconds; for i := 1 to size do begin new(ar[i]); for j := 1 to 256 do ar[i]^[j] := 0; end; r2 := real_seconds; writeln('Alloc speed - alloc ', num_alloc:2, 1000*(r2 - r1) / size:8:1); end; begin for num_alloc := 1 to max_alloc do alloc; end. -------------------------------------------------------------------------------