help-octave
[Top][All Lists]
Advanced

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

Re: memory management in ocf-files


From: Jordi Gutiérrez Hermoso
Subject: Re: memory management in ocf-files
Date: Mon, 1 Oct 2012 09:08:14 -0400

On 1 October 2012 09:03, Jose <address@hidden> wrote:
> The whole application that I am working with is somehow complex, with
> threads, sockets and handling real time data gathered from some remote
> sensors.

By the way, would you be interested in trying the new instrument
control package?

    http://wiki.octave.org/Instrument_control_package#Example_3:_Logic_analyzer

> So, as measurements arrive, the receiving threads will create new octave
> structures and matrices that are stored in the buffers waiting to be passed
> to octave through an oct-file. I am concerned about what happens with all
> that memory once that the data has been passed to octave and used. Does
> octave delete those objects automatically or should I do something to free
> the memory?

Octave uses COWs:

    http://en.wikipedia.org/wiki/Copy_on_write

If you pass data into an Octave class (e.g. Array, Matrix, any member
of the octave_value hierarchy), then it expects to own the data and do
its own copying and cleanup.

You can also use the mex interface in Octave, but it's just a wrapper
over the Octave classes. Yes, perhaps a wrapper could be slightly
slower, but try using your existing mex code before you decide it's
too slow and you need to rewrite it for Octave.

Do note your GPL obligations regarding Octave:

    http://wiki.octave.org/FAQ#Licensing_issues

HTH,
- Jordi G. H.


reply via email to

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