Re: Out of memory

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

Bob Thompson wrote:
> Has anyone any ideas why the following programme works OK
> with a 1.47 GHz Athlon 1700+ processor, 512MB RAM and 0.75
> to 1.5 GB swap file, albeit with memory swapping for 7 mins,
> but runs out of memory with a Pentium (R) 4 CPU 4.39 GHz
> (Pentium 640 with hyperthreading and 2MB cache), 2GB RAM
> and 3 to 5 GB swap file when the loop number is 41441051?
> 
> Both have XP as operating system.
> 
> The Pentium box runs at maximum 50% CPU usage for a single
> thread application. If I run the programme a few times
> simultaneously, the Pentium peaks at 100% CPU usage and goes
> into memory swapping but each programme terminates at the same
> loop number.
> 
> Incidentally, with smaller loops (i.e no memory swapping), the
> Pentium's only 80% faster than the Athlon for this application.
> 
> --run as an .exw file
> atom t
> sequence s
> 
> s = {}
> 
> t = time()
> 
> for n = 1 to 200000000 do
> s = append(s, n)--sequence s needs 800000024 bytes
> end for
> 
> ?time() -t
> 
> machine_proc(26,0)
> 
> If I create more, say ten, shorter sequences within a single
> application instead of one long one, I can approach 2GB before
> it quits but I still run out of memory where the total number of
> bytes needed for all sequences is well short of total memory
> availability.
> 
> Is this a Windows or a Euphoria memory management issue, can I
> change any settings, or am I pushing the limits a little too
> high in this test?

I don't know what's going on in your two systems,
but keep in mind that a sequence requires contiguous memory.
Every now and then append() must allocate a new space
bigger than what the sequence is using already, and copy 
the sequence into that new space, before the old space is freed. 
So sometimes you will have slightly more than
double the space allocated. And it could be that you have
enough total space for those two blocks, but it's fragmented 
into smaller blocks that aren't big enough.

Using repeat() to create the size that you need,
might work a lot better.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu