Einzelnen Beitrag anzeigen

Kas Ob.

Registriert seit: 3. Sep 2023
347 Beiträge
 
#2

AW: Arraygrösse und Stack Overflow

  Alt 21. Feb 2024, 13:36
Hi,

This small array ("kleines") made me spill my coffee !

The size of this "Small" is
1001*11*10001 = 110121011 element then for integers
110121011 * 4 = 440484044 byte , and this is more than 400 Megabyte !

So, no the stack will no hold that, you have to switch to dynamic arrays and it will (or might) work if you have enough RAM to allocate such continuous allocation.
Or if possible divide the calculation process into real small pieces, even then don't use the stack allocated, use the heap.
Kas
  Mit Zitat antworten Zitat