help-octave
[Top][All Lists]
Advanced

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

Re: memory usage query


From: JuanPi
Subject: Re: memory usage query
Date: Fri, 6 Nov 2015 11:41:45 +0100

On Fri, Nov 6, 2015 at 11:28 AM, Markus Bergholz <address@hidden> wrote:
>
> Am 06.11.2015 11:22 vorm. schrieb "JuanPi" <address@hidden>:
>>
>> Hi,
>> What is the best way to know how much memory is being used by octave
>> variables?
>> whos doesn't do the trick since
>>
>> A = rand(1e3);
>> whos
>>
>> Variables in the current scope:
>>
>>    Attr Name        Size                     Bytes  Class
>>    ==== ====        ====                     =====  =====
>>         A        1000x1000                 8000000  double
>>
>> Total is 1000000 elements using 8000000 bytes
>>
>> B = A;
>> whos
>> Variables in the current scope:
>>
>>    Attr Name        Size                     Bytes  Class
>>    ==== ====        ====                     =====  =====
>>         A        1000x1000                 8000000  double
>>         B        1000x1000                 8000000  double
>>
>> Total is 2000000 elements using 16000000 bytes
>>
>> So it says we are using the double amount of memory, but afaiu B = A
>> did not create a copy of A, so the reported memory assumes COW was
>> executed.
>
> When you're using Linux you can check how much memory is used by a PID
> number.
> https://github.com/octave-de/macgyver_utils/blob/master/memory.m
> But this is more generalized for the Octave process and not limited just to
> the workspace
>
>>
>> --
>> JuanPi Carbajal
>> Public GnuPG key: 9C5B72BF
>> -----
>> The end of funding: "Many researchers were caught up in a web of
>> increasing exaggeration."
>> - Hans Moravec
>>
>> _______________________________________________
>> Help-octave mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/help-octave

Thank you Markus,

I have created a pull request to return the results.


-- 
JuanPi Carbajal
Public GnuPG key: 9C5B72BF
-----
The end of funding: "Many researchers were caught up in a web of
increasing exaggeration."
- Hans Moravec



reply via email to

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