Memory control

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Memory control

Joao Rodrigues

I need to functions which, when applied to large objects, require more
memory than that available and the system freezes. (It's the csv2cell
function for file input, but I guess this situation is more general.)

I wonder if there is some function that can get information about the
amount of RAM available and that currently used by Octave so that the
program aborts if its memory requirements exceed a certain threshold.

Suggestions are welcome.

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Memory control

Markus Bergholz



On Sun, Sep 7, 2014 at 1:21 PM, João Rodrigues <[hidden email]> wrote:

I need to functions which, when applied to large objects, require more memory than that available and the system freezes. (It's the csv2cell function for file input, but I guess this situation is more general.)

I wonder if there is some function that can get information about the amount of RAM available and that currently used by Octave so that the program aborts if its memory requirements exceed a certain threshold.

more or less,....and only for linux plattform
https://github.com/markuman/linux/blob/master/octave/memory.m

octave:1> memory

 Memory used by Octave:   34.0039 MB
 Physical Memory (RAM): 7929.52 MB



 

Suggestions are welcome.

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave



--
icq: 167498924
XMPP|Jabber: [hidden email]

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Memory control

Markus Bergholz
In reply to this post by Joao Rodrigues



On Sun, Sep 7, 2014 at 1:21 PM, João Rodrigues <[hidden email]> wrote:

I need to functions which, when applied to large objects, require more memory than that available and the system freezes. (It's the csv2cell function for file input, but I guess this situation is more general.)

I wonder if there is some function that can get information about the amount of RAM available and that currently used by Octave so that the program aborts if its memory requirements exceed a certain threshold. 

Suggestions are welcome.


oh, and when you're using linux, you can limit the ram usage of octave with ulimit too.

 
_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave



--
icq: 167498924
XMPP|Jabber: [hidden email]

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Memory control

Joao Rodrigues

I wonder if there is some function that can get information about the amount of RAM available and that currently used by Octave so that the program aborts if its memory requirements exceed a certain threshold.


more or less,....and only for linux plattform
https://github.com/markuman/linux/blob/master/octave/memory.m


oh, and when you're using linux, you can limit the ram usage of octave with ulimit too.

Thanks, ulimit is exactly what I was looking for! Are you aware of anything similar in Windows?

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Memory control

Philip Nienhuis
In reply to this post by Joao Rodrigues
Joao Rodrigues wrote
I need to functions which, when applied to large objects, require more
memory than that available and the system freezes. (It's the csv2cell
function for file input, but I guess this situation is more general.)

I wonder if there is some function that can get information about the
amount of RAM available and that currently used by Octave so that the
program aborts if its memory requirements exceed a certain threshold.

Suggestions are welcome.
Matlab has a call for it, that returns the size of the largest available contiguous block of RAM (AFAICS that's different than the other suggestions in this thread).
TTBOMK in Octave you can only infer it indirectly by trying to create (and destroy) still bigger arrays until you've hit the limit.

philip