sefiroths sefiroths CCArray or normal array with 300000 elements make app crash
Posts 8
Added by sefiroths sefiroths 11 months ago

hi all, i'm new to android development.
i have a array of strings, first i have tryed with

char buf[300000][30];

but the app crashes, so i have tried with
   std::vector<string> array(300000);

but crashes however.
if i make in iphone the app goes well.
how can i manage an array so big?
thanks

Oren Bengigi RE: CCArray or normal array with 300000 elements make app crash
Posts 109
Added by Oren Bengigi 11 months ago

Try splitting it to several arrays.
Maybe the OS cannot handle such a big consecutive memory allocation.

sefiroths sefiroths RE: CCArray or normal array with 300000 elements make app crash
Posts 8
Added by sefiroths sefiroths 11 months ago

ok i'll try. thanks

James Chen RE: CCArray or normal array with 300000 elements make app crash
Posts 671
Added by James Chen 11 months ago

I think you should allocate memory on the heap rather than the stack.


(1-3/3)