Re: Out of Memory
- Posted by Pete Eberlein <xseal at HARBORSIDE.COM> Apr 09, 2000
- 849 views
On Sun, 9 Apr 2000 16:12:58 -0700, simulat <simulat at INTERGATE.BC.CA> wrote: >Thanks Jiri > >Yeow - 16 bytes per atom is a lot of overhead! Maybe I'll need to try some >kind of direct memory access instead of using sequences for this. Darn. Be prepared to lose a lot of speed peek-poking atom_to_float64s >But why will the sequence initialize without problems, but then crash later >as it's being used? As far as I can tell the sequence size should be staying >the same with the contents only being modified. You initialized the sequence to integers which take only 4 bytes apiece plus sequence overhead: ps=repeat(repeat(250,1250),1750) sizeof ps ~= 24 + 1750*(24 + 4*1250) = 8,792,024 bytes but when you start assigning non-integer values to the sequence, each integer mutates into a 16-byte atom thus slowing increasing to about: 24 + 1750*(24 + 16*1250) = 35,042,024 bytes like Jiri said A solution might be to store the return values as fixed-point integers: ps[i][j]= floor( strange(Degree(Aangle(Field[x], Field[y])), numcolours, 360) -- evaluates to an atom * #10000) -- evaluates back to integer Then whenever you want to get an element out of ps, you have to remember to divide by #10000 to get its actual value. This would have to same memory requirements as the integer size. -- Pete Eberlein >Bye >Martin > >----- Original Message ----- >From: Jiri Babor <J.Babor at GNS.CRI.NZ> >To: <EUPHORIA at LISTSERV.MUOHIO.EDU> >Sent: Sunday, April 09, 2000 4:01 PM >Subject: Re: Out of Memory > > >> Correction, Martin! I wrongly assumed you had a *pair* of coordinates >> in each case, stupid. In your case you actually need only >> >> ((16 * 1250) + 24) * 1750 = 35,042,000 bytes >> >> But the system probably needs to hold *two* copies of the sequence at >> some stage, not to mention operating system requirements. I hope I am >> right this time :) jiri >>