Rob: Out of memory + broken shorthand assignment operators in expressions
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?
>
> Thanks in advance for any help,
>
> Bob
This is quite interesting because I've written small programs
simular to that, and Euphoria runs out of memory (every time)
at loop 141441051. I didnt think of reporting it, because I
thought my computer was running out of memory. Adjusting the
swap file size did nothing.
My computer is a 2.66 GHz Pentium 4 Northwood 512 KB L2 cache;
512 MB DDR SD-RAM @ 333 MHz; 512 MHz front-side bus; Windows XP
SP 2.
I discovered an issue that has to do with assignment operators
failing to work in conditional or loop expressions. My guess
is that this been a issue since they were introduced in
Euphoria v2.1.
For example:
-- this code runs
integer i, f
i = 0
f = 0
if i = i + 1 then
end if
while f = f + 1 do
end while
machine_proc(26,0) -- wait_key
But...
-- this code fails with an error
integer i, f
i = 0
f = 0
if i += 1 then
end if
while f += 1 do
end while
machine_proc(26,0) -- wait_key
The same thing happens with -=, /=, *=, and
&= (with sequences).
Regards,
Vincent
|
Not Categorized, Please Help
|
|