[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #52980] clear in the caller workspace doesn't
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #52980] clear in the caller workspace doesn't clear all references to a variable. |
Date: |
Fri, 26 Jan 2018 14:00:12 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:51.0) Gecko/20100101 Firefox/51.0 |
URL:
<http://savannah.gnu.org/bugs/?52980>
Summary: clear in the caller workspace doesn't clear all
references to a variable.
Project: GNU Octave
Submitted by: None
Submitted on: Fri 26 Jan 2018 07:00:11 PM UTC
Category: Performance
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Performance
Status: None
Assigned to: None
Originator Name: Rahnema
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 4.2.1
Operating System: GNU/Linux
_______________________________________________________
Details:
Hi all!
Comparing the following example:
B = rand(5000);
B(1) = 7;
with this one:
function f(A)
evalin('caller', 'clear V')
A(1) = 5;
end
V = rand(5000);
f(V);
I can use _time_ to get the maximum memory consumption of a process:
/usr/bin/time -f "%M" octave -q --eval "V=rand(5000);function
f(A);evalin('caller', 'clear V');A(1)=5;end;f(V);"
Interestingly the second example consumes two times more than the first
example.
When 'V' is cleared from the caller workspace we should have only one instance
of the 5000*5000 array in the function scope but when the local 'A' is
modified a copy is created! It seems that 'clear' can't clear all references
to the array object in the caller workspace.
Best regards,
Rahnema.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52980>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #52980] clear in the caller workspace doesn't clear all references to a variable.,
anonymous <=