help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: octave memory


From: Rob Mahurin
Subject: Re: octave memory
Date: Wed, 11 Feb 2009 12:44:04 -0500

On Feb 11, 2009, at 11:45 AM, John W. Eaton wrote:
On 11-Feb-2009, Søren Hauberg wrote:

| ons, 11 02 2009 kl. 17:31 +0100, skrev jean francois sauvage:
| > 2) Actually, the "who" command gives information about the size of
| > variables. This is not exactly what I need. I need to know how much
| > memory has been allocated while the execution of a program.
| >
| > the function memory() of IDL returns 4 arguments :
| >  - the actual amount of dynamic memory used by IDL
| >  - the number of memory allocation since last call to memory()
| >  - the number of memory unallocation since last call to memory()
| > - the maximum amount of dynamic memory readched since last call to memory()
| >
| > I am looking for something similar (particularly for the first and
| > fourth arguments) in octave.

Octave doesn't keep track of these statistics.

Why do you think you need this information?


I had a problem where this information would have been useful, and I wound up sort-of getting it from the operating system.

I had several thousand data files, each containing a 48x100x10,000 = 200MB array of four-bit integers from a set of analog-to-digital converters (and about 100MB of other stuff). For some parts of my analysis I needed only to do arithmetic with these integers, and an ugly set of loops in Some Other Language was much harder to tweak than a few lines of reshape(), sum(), diff(). For other parts I needed to convert to floating-point, or a conversion to floating- point would happen implicitly somewhere. I spent a bunch of debugging time looking for those 400MB temporaries.

I wound up keeping a running tally of the memory used with a shell script that called "free" and wrote to a file. An octave function where I could have written
memory; my_function(data); memory
## maximum memory usage between calls: 1.5 GB
would have sped this debugging along quite a bit.

Cheers,
Rob

--
Rob Mahurin
Department of Physics and Astronomy
University of Tennessee                 865 207 2594
Knoxville, TN 37996                     address@hidden






reply via email to

[Prev in Thread] Current Thread [Next in Thread]