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

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

[Octave-bug-tracker] [bug #63791] movfun - high intermediate memory use


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #63791] movfun - high intermediate memory use for moderate data input resulting in out of memory errors
Date: Tue, 28 Feb 2023 14:16:20 -0500 (EST)

Follow-up Comment #35, bug #63791 (project octave):

Copying what I posted in the discourse thread:

Indexing to create a contiguous slice of data from an array will increment the
reference count of the data and set a pointer to the beginning of the slice
and the slice length. Then if you modify an element of either the slice or the
original array, you’ll force a copy of the entire array.

We could be clever about the modification to the slice and only copy the data
required for the slice. That can avoid a lot of wasted storage if the slice is
small compared to the original array. Maybe we are already doing that (again,
I don’t remember and didn’t look just now). But it doesn’t help if the
modification is to the original array. In that case, we currently have no way
to look at the other handles to the data and try to do something clever. And
I’m not sure that we really want to attempt that because it probably means
storing a list of pointers back from the ArrayRep object to all of the Array
handles that reference it.

Given the number of times this issue has been raised and caused confusion, it
seems best to me to just eliminate this attempted optimization.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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