[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #65669] Memory Leak when Using Cell
From: |
Arun Giridhar |
Subject: |
[Octave-bug-tracker] [bug #65669] Memory Leak when Using Cell |
Date: |
Wed, 1 May 2024 18:57:46 -0400 (EDT) |
Follow-up Comment #2, bug #65669 (group octave):
Works for me on Linux (not Ubuntu though).
I modified the test code to add some whos and printf statements:
gatherFun = @(n) zeros(n, 160000, "single");
numPts = randi([3 11], [1600 1]);
numRuns = 2;
for curRun = 1:numRuns
printf ("Starting iteration# %d\n", curRun)
myData = cellfun(gatherFun, num2cell(numPts), "UniformOutput", false);
# Manual release of memory
for chunk = 1:numel(myData)
myData{chunk} = 0;
endfor
whos
printf ("Ending iteration# %d\n", curRun)
end
whos
clear all
This is what I get with both Octave 9 and Octave 10 on Linux:
Starting iteration# 1
Variables visible from the current scope:
variables in scope: top scope
Attr Name Size Bytes Class
==== ==== ==== ===== =====
chunk 1x1 8 double
curRun 1x1 8 double
gatherFun 1x1 0 function_handle
myData 1600x1 12800 cell
numPts 1600x1 12800 double
numRuns 1x1 8 double
Total is 3204 elements using 25624 bytes
Ending iteration# 1
Starting iteration# 2
Variables visible from the current scope:
variables in scope: top scope
Attr Name Size Bytes Class
==== ==== ==== ===== =====
chunk 1x1 8 double
curRun 1x1 8 double
gatherFun 1x1 0 function_handle
myData 1600x1 12800 cell
numPts 1600x1 12800 double
numRuns 1x1 8 double
Total is 3204 elements using 25624 bytes
Ending iteration# 2
Variables visible from the current scope:
variables in scope: top scope
Attr Name Size Bytes Class
==== ==== ==== ===== =====
chunk 1x1 8 double
curRun 1x1 8 double
gatherFun 1x1 0 function_handle
myData 1600x1 12800 cell
numPts 1600x1 12800 double
numRuns 1x1 8 double
Total is 3204 elements using 25624 bytes
octave:8> whos
octave:9>
Can you confirm that the memory you see in `top` is actually *used* by Octave
and not just cached by the OS? You can try changing the system's swappiness.
Or before that you could try something like "sudo sync ; sudo sysctl -w
vm.drop_caches=3" if you understand what those commands do.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?65669>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #65669] Memory Leak when Using Cell, Henry Shu, 2024/05/01
- [Octave-bug-tracker] [bug #65669] Memory Leak when Using Cell,
Arun Giridhar <=
- [Octave-bug-tracker] [bug #65669] Memory Leak when Using Cell, Henry Shu, 2024/05/01
- [Octave-bug-tracker] [bug #65669] Memory Leak when Using Cell, Arun Giridhar, 2024/05/01
- [Octave-bug-tracker] [bug #65669] Memory Leak when Using Cell, Henry Shu, 2024/05/02
- [Octave-bug-tracker] [bug #65669] Memory Leak when Using Cell, Nicholas Jankowski, 2024/05/02
- [Octave-bug-tracker] [bug #65669] Memory Leak when Using Cell, Nicholas Jankowski, 2024/05/02
- [Octave-bug-tracker] [bug #65669] Memory Leak when Using Cell, Arun Giridhar, 2024/05/02
- [Octave-bug-tracker] [bug #65669] Memory Leak when Using Cell, Nicholas Jankowski, 2024/05/02
- [Octave-bug-tracker] [bug #65669] Memory Leak when Using Cell, Nicholas Jankowski, 2024/05/02
- [Octave-bug-tracker] [bug #65669] Memory Leak when Using Cell, Arun Giridhar, 2024/05/02
- [Octave-bug-tracker] [bug #65669] Memory Leak when Using Cell, Henry Shu, 2024/05/02