Question about array memory
If I use
Global VarCol(144000,450) as double, I will get no out of memory in VB6 Windows 10
But if I use Global VarCol(144000,500) as double, the out of memory pops up. It's only a array of 144001 x 501 x double = 577 MB and I have 32GB of memory, so I don't understand that there isn't room enough for this array.
I understood I could use arrays up to 2Gb.
Thanks in advance
Re: Question about array memory
Re: Question about array memory
I don't know/use VB6 so this is an educated guess. Memory is allocated from 2 places - stack and heap. Stack memory is usually allocated for fixed size variables when the size is known at compile time. Heap (or dynamic) memory is usually allocated when the size is only determined at run-time. There is a limit to how much stack memory is available - irrespective of how much actual physical memory is available. Without knowing VB6 I'm guessing that the VB6 compiler is trying to allocate the memory for VarCol on the stack and is running out of stack memory. Is there a way in VB6 to dynamically allocate memory for an array at runtime?
Sorry I can't be more help - I only use c++ and VB6 might do things very different. In c++ I can allocate an array of 144000 x 500 OK.
Re: Question about array memory