LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW: Memory is full error.


@altenbach wrote:

@Yamaeda wrote:

A Reshape only changes how the data is interpreted, it shouldn't touch the data,


In the distant past, reshape array always showed a buffer allocation, but under some conditions it could probably re-use the buffer. (Back then, the help falsely claimed that it operates in place, but that got removed from the help long ago). Going from 1D to 2D, the size header needs to grow by 4 bytes in memory. Since the function can also be used to pad (or trim) an array, it might need a new allocation, especially if the new dimension sizes are not constants as in this case. (e.g. reshaping a 2D array with 1 element to a 1000x1000 2D array will need room for 1M points).

 

(I am not claiming that I know the internal details how the compiler handles all that, but it is clear that the data needs to be touched in at least some scenarios)


Ah, yes, i assumed the requested reshaping had the same amount of elements, else it'll obviously need to pad/buffer. In this case it's irrelevant though as it's some 8k elements so unless the program runs on a Vic-20 it'll fit. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 11 of 12
(230 Views)

A Reshape only changes how the data is interpreted, it shouldn't touch the data

This ofttimes-fact really saved my bacon once upon a very (very) long time ago.  To use a Ben-ism, here's more of that particular "Sea Story".

 

(But heed what altenbach wrote -- the ability to operate in-place isn't guaranteed nor even always *possible*)

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 12 of 12
(205 Views)