help-octave
[Top][All Lists]
Advanced

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

octave memory


From: Andreas Stahel
Subject: octave memory
Date: Thu, 5 Mar 2009 09:33:07 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

To who it may concern

I had the identical question a few weeks ago and found a working solution on 
Linuz systems

I hope it helps

Andreas

function [time,cpu,vsize,rsize]=octave_ps()
% [time,cpu,vsize,rsize]=octave_ps()
%
% report proces ststus of Unix system on current octave job
% time   time consumed by the current job in sec
% cpu    % of cpu usage of overall job
% vsize  size of virtual memory in kB
% rsize  size of real memory in kB


% Andreas Stahel, summer 2008 cmdstring=["ps --pid ",num2str(getpid())," -o time= -o pcpu= -o vsize= -o rssize="];
 [status,ps_out]=system(cmdstring);
 blanks=find(ps_out==" ");
 times= ps_out(1:blanks(1));
 time= str2num(times(7:8))+60*(str2num(times(4:5))+60*str2num(times(1:2)));
 [cpu,vsize,rsize] = sscanf(ps_out(blanks(1)+1:end),"%f%i%i","C");
%  cpu = str2num(ps_out(blanks(2)+1:blanks(3)));
%  vsize = str2num(ps_out(blanks(3)+1:blanks(4)));
%  rsize = str2num(ps_out(blanks(4)+1:end));
endfunction



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?

jwe


--
Andreas Stahel       E-Mail: address@hidden
Mathematics, BFH-TI  Phone: ++41 +32 32 16 258
Quellgasse 21        Fax:   ++41 +32 321 500
CH-2501 Biel         WWW:   http://prof.ti.bfh.ch/sha1/
Switzerland



reply via email to

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