1. running out of memory

is there any way i can discover how much memory was being used at the point my
app ran out of memory?

that would allow me to limit (for example) sequence length to something wouldn't
halt the app. trial and error turns up varying results.

forgetfully,

--
jon

new topic     » topic index » view message » categorize

2. Re: running out of memory

Um, are you using windows 2000 or XP?

Press Ctrl+Shift+Escape to bring up the task manager, and select the
processes tab - that'll show all the running programs, and the amount
of memory the instance of exw.exe that was interpreting your program
was using.

Am I misunderstanding what you're after? If you wanted to know how
many elements you managed to squeeze into your main sequence before it
ran out of memory... (I assume it crashes on running out of memory?)
... I suppose you could just have a variable that would contain the
length of the sequence, and update it every iteration of the program
loop...

On 12/30/05, jxliv7 <guest at rapideuphoria.com> wrote:
> is there any way i can discover how much memory was being used at the poi=
nt my app ran out of memory?
>
> that would allow me to limit (for example) sequence length to something w=
ouldn't halt the app. trial and error turns up varying results.
>
> forgetfully,
>
> --
> jon

--
MrTrick
----------

new topic     » goto parent     » topic index » view message » categorize

3. Re: running out of memory

Hi

Yes in windows, either use ctrl-alt-del, and check the running processes (you 
may have to select the field to view)

In Linux use KDE system guard (or top for console)

Chris

new topic     » goto parent     » topic index » view message » categorize

4. running out of memory

--here's a 'running out of memory' problem I'm having.
--"cut and paste" and see what you get...
--
-- J-TEST-1.EX
-- it's a routine to (create and) add a large sequence of numbers together
--

sequence a, b, c
integer lena, lenb
atom t1

a = repeat(9, 7000000)      --trying it from 1,000,000 to 8,000,000 (+)
b = a

t1 = time()             --begin timing cycle

lena = length(a)        --where a and b are made the same length
lenb = length(b)        --by prepending zeros as necessary
if lena > lenb then
        b = repeat(0, lena-lenb) & b
    elsif lenb > lena then
        a = repeat(0, lenb-lena) & a
end if

c = a                   --ready the result sequence

c = a + b               --add the numbers

c = 0 & a                       --begin the normalizing of the number
for i = lena+1 to 2 by -1 do      --an 'add the carries' routine
    while c[i] > 10 do
        c[i-1] += 1
        c[i] -= 10
    end while
end for
if c[1] = 0 then
    c = c[2..lena+1]
end if

t1 = time() - t1        --end timing cycle

--? c                   --print test results
? lena
? t1

--here's what's happening::::::
--for  1 million digits, it takes 0.5 second
--     5 million digits is 2.09 to 2.42 seconds
--     6 million digits is 2.47 to 2.69 seconds
--     7 million digits is 3.9-5.44-9.83+ seconds plus some disk activity
--     8 million digits, it runs out of memory after much disk activity
--
--my machine = win98, AMD K62 333, 96 MB SDRAM, 788 MB free HDD...
--
--the question is, why do I run out of memory...?
--
--if it's 4 bytes/integer, 8 M * 4 = 32 M * 3 (a, b, c) = 96 M
--but with 96 MB RAM plus 192 MB swap file and 788 MB of HDD free, uhh...?
--I am running a fixed frequency monitor, so no options to go to straight
DOS.
--
--and why the variations on the timing...? (nothing running)
--
--in a similar test program it seems to keep going up to 1 minute, then it's
--"out of memory" after a lot of disk activity. same 8 M numbers.
--
--WHY? thanks...!
--

new topic     » goto parent     » topic index » view message » categorize

5. Re: running out of memory

j77 writes:
> my machine = win98, AMD K62 333, 96 MB SDRAM,
> 788 MB free HDD...
> the question is, why do I run out of memory...?

Temporary variables are sometimes created. e.g.

> c = 0 & a

A 32Mb temporary is created just before the old 32Mb
value of c is destroyed. For a brief moment, both exist.
(I've been considering optimizing this.)

Win98 is not going to give you *all* of the 96Mb RAM
on your machine, nor will it let you use anywhere near
all of your free disk space for swapping. I would imagine
that it keeps several megabytes RAM for it's own use.

When Euphoria fails to allocate an extra 32Mb, it may be
the case that the operating system has 32Mb available,
but not all in one huge contiguous piece.

When swapping starts to happen your program will slow
down considerably, and the timings will not be very consistent.

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

new topic     » goto parent     » topic index » view message » categorize

6. Re: running out of memory

----- Original Message -----
From: Robert Craig <rds at ATTCANADA.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Wednesday, February 16, 2000 2:05 PM
Subject: Re: running out of memory


> j77 writes:
> > my machine = win98, AMD K62 333, 96 MB SDRAM,
> > 788 MB free HDD...
> > the question is, why do I run out of memory...?
>
> Temporary variables are sometimes created. e.g.
>
> > c = 0 & a
>
> A 32Mb temporary is created just before the old 32Mb
> value of c is destroyed. For a brief moment, both exist.
> (I've been considering optimizing this.)

*Please* do !
If data is appended, or the resulting datasize is the same or less, then
allocating new memory isn't necessary. I'd expect a big speedup for not
allocating more memory. Not that i know how this is actually done in
windoze.

Kat

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu