objective c - used memory: c-array vs. NSMutableArray -
i need store 1.000.000 double values in different arrays (during calculation run). far i'm using nsmutablearray
looks memory usage huge. 1 idea use c-array in order avoid storage of objects in nsmutablearray
. there way estimate memory usage of nsmutablearray vs. , c-array? (i not find information size of nsnumber
-object vs. primitive double or float).
thanks.
it's pretty clear memory consumption of nsarray
bigger of raw c array.
how big difference be? well, every value in nsarray
, every primitive double
has wrapped nsnumber
@ least 20 b added every value, bit more.
one estimate can found here: memory size of classes in objective-c
anyway, storing 1 000 000 values in memory bit strange. maybe better store them in file , load them when needed (e.g. using memory mapped file).
Comments
Post a Comment