octave-maintainers
[Top][All Lists]
Advanced

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

Re: Is this a memory leak?


From: John W. Eaton
Subject: Re: Is this a memory leak?
Date: Tue, 19 Jul 2016 13:14:26 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0

On 07/19/2016 12:46 PM, Susi Lehtola wrote:
On 07/19/2016 05:27 AM, John W. Eaton wrote:
On 07/19/2016 02:42 AM, Susi Lehtola wrote:
Is this a memory leak, since y is dynamically allocated but it's given
as a dereferenced pointer to octave_value?

Yes, it is a leak.  You don't need to create the RowVector object with
new.  The memory for RowVector, octave_value, and nearly all other
objects in Octave is managed by reference counting.

Right, just as I thought.

I tried running octave through valgrind, but I don't get any output..

What options did you use for valgrind?

$ valgrind --leak-check=full octave --eval "pkg load
gsl;A=legendre_sphPlm_array(10,10,0.0);"
==6971== Memcheck, a memory error detector
==6971== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==6971== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==6971== Command: octave --eval pkg\ load\
gsl;A=legendre_sphPlm_array(10,10,0.0);
==6971==
octave: X11 DISPLAY environment variable not set
octave: disabling GUI features

Without the semicolon you see the array, but again the usual valgrind
output is missing..?

The "octave" program is now just a small wrapper program that forks and execs octave-gui or octave-cli. So valgrind is just reporting about leaks in that program. Try your test again using octave-cli instead of octave.

jwe





reply via email to

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