[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #58790] Octave closes unexpectedly when memory
From: |
Hg200 |
Subject: |
[Octave-bug-tracker] [bug #58790] Octave closes unexpectedly when memory allocation fails (Windows 32bit executable) |
Date: |
Fri, 4 Sep 2020 03:25:45 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 |
Follow-up Comment #22, bug #58790 (project octave):
I have read that modern operating systems often over-allocate. Malloc and new
can return a valid pointer even if there is not enough free memory. I.e.
std::bad_alloc is never raised, or at least is not a reliable indicator of
memory exhaustion. I haven't found a literature reference so far, but that
could be a problem.
For example if try hard enough i can even kill Octave on linux 64 bit:
++
...
Allocate 44000 MByte
Allocate 45000 MByte
Allocate 46000 MByte
Killed
--
For this you have to run following example and choose N big enough.
++
used = 0;
N = 13107200;
chars = char([65:90, 97:122]);
for idx = 1 : length (chars)
chunk = N * 8 * 10 / (1024 * 1024);
fprintf ('Allocate %i MByte\n', used + chunk);
x.(chars(idx)) = rand (N, 10);
used = used + chunk;
end
fprintf ('success\n');
whos ('x');
--
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?58790>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/