Sorry... the out of memory was not caused by the allocation, but because i did a mistake....
but my questions are still valid:
How does B4A handle the memory consumption of arrays? I often ReDIM my main array inside a SUB. Until now I had no problems with this.
sub Globals
Private MainArray(1000) as SHORT
Public Converter As ByteConverter
end sub
Sub OftenUsedSub
Dim locBytes() as Byte
Stream.ReadBytes(locBytes,......
Dim locArray() as Short = Converter.ShortsFromBytes(locBytes)
....
MainArray=locArray
End Sub
As you see, I change the size of the array inside SUBs when receiving Bytes from Stream. Will this change the pointer? What will happen with the prior array content? Will this eat RAM, when I do it often?
Can I scan the remaining memory size to detect problems?