octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #62459] Severe memory leak when functions are


From: Rik
Subject: [Octave-bug-tracker] [bug #62459] Severe memory leak when functions are nested
Date: Mon, 16 May 2022 17:31:20 -0400 (EDT)

Follow-up Comment #5, bug #62459 (project octave):

A quick analysis:


  R = p*rand(1);
  leak_anon_fcn = @() 1./ R;


The first line produces one copy of the input in the variable R.

The second line produces a second copy of the input because variables are
replaced by their values when an anonymous function is created.  For example,


x = 3;
f = @() 1./ x;


is equivalent internally to


f = @() 1./ 3


I'm not sure where the third copy is coming from.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62459>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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