Einzelnen Beitrag anzeigen

johndoe049

Registriert seit: 22. Okt 2006
140 Beiträge
 
#3

AW: Arraygrösse und Stack Overflow

  Alt 21. Feb 2024, 12:46
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.
Hallo,

wie schaltet man das auf Heap um? Arbeitsspeicher ist genug vorhanden (ca. 196 GB Ram)
  Mit Zitat antworten Zitat