Original Post
[font=Arial,]Im having trouble with memory on older generation iPhones (ipod touch 1st gen, 2nd gen e.t.c). This is due to the amount of memory allocated when I load and store a 170k word dictionary.
Im having trouble with memory on older generation iPhones (ipod touch 1st gen, 2nd gen e.t.c). This is due to the amount of memory allocated when I load and store a 170k word dictionary.
This is the code (very simple):
[color=#00008B]string[color=#000000][][color=#000000] words [color=#000000]=[color=#000000] dictionaryRef[color=#000000].[color=#000000]text[color=#000000].[color=#2B91AF]Split[color=#000000]([color=#800000]"\n"[color=#000000][[color=#800000]0[color=#000000]]);[color=#000000]
_words [color=#000000]=[color=#000000] [color=#00008B]new[color=#000000] [color=#2B91AF]List[color=#800000][color=#000000]([color=#000000]words[color=#000000]);[color=#000000]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
[color=#00008B]
string[color=#000000][][color=#000000] words [color=#000000]=[color=#000000] dictionaryRef[color=#000000].[color=#000000]text[color=#000000].[color=#2B91AF]Split[color=#000000]([color=#800000]"\n"[color=#000000][[color=#800000]0[color=#000000]]);[color=#000000]
_words [color=#000000]=[color=#000000] [color=#00008B]new[color=#000000] [color=#2B91AF]List[color=#800000][color=#000000]([color=#000000]words[color=#000000]);[color=#000000]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
words [color=#000000]=[color=#000000] dictionaryRef[color=#000000].[color=#000000]text[color=#000000].[color=#2B91AF]Split[color=#000000]([color=#800000]"\n"[color=#000000][[color=#800000]0[color=#000000]]);[color=#000000]
_words [color=#000000]=[color=#000000] [color=#00008B]new[color=#000000] [color=#2B91AF]List[color=#800000][color=#000000]([color=#000000]words[color=#000000]);[color=#000000]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
dictionaryRef[color=#000000].[color=#000000]text[color=#000000].[color=#2B91AF]Split[color=#000000]([color=#800000]"\n"[color=#000000][[color=#800000]0[color=#000000]]);[color=#000000]
_words [color=#000000]=[color=#000000] [color=#00008B]new[color=#000000] [color=#2B91AF]List[color=#800000][color=#000000]([color=#000000]words[color=#000000]);[color=#000000]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
text[color=#000000].[color=#2B91AF]Split[color=#000000]([color=#800000]"\n"[color=#000000][[color=#800000]0[color=#000000]]);[color=#000000]
_words [color=#000000]=[color=#000000] [color=#00008B]new[color=#000000] [color=#2B91AF]List[color=#800000][color=#000000]([color=#000000]words[color=#000000]);[color=#000000]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
Split[color=#000000]([color=#800000]"\n"[color=#000000][[color=#800000]0[color=#000000]]);[color=#000000]
_words [color=#000000]=[color=#000000] [color=#00008B]new[color=#000000] [color=#2B91AF]List[color=#800000][color=#000000]([color=#000000]words[color=#000000]);[color=#000000]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
"\n"[color=#000000][[color=#800000]0[color=#000000]]);[color=#000000]
_words [color=#000000]=[color=#000000] [color=#00008B]new[color=#000000] [color=#2B91AF]List[color=#800000][color=#000000]([color=#000000]words[color=#000000]);[color=#000000]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
0[color=#000000]]);[color=#000000]
_words [color=#000000]=[color=#000000] [color=#00008B]new[color=#000000] [color=#2B91AF]List[color=#800000][color=#000000]([color=#000000]words[color=#000000]);[color=#000000]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
_words [color=#000000]=[color=#000000] [color=#00008B]new[color=#000000] [color=#2B91AF]List[color=#800000][color=#000000]([color=#000000]words[color=#000000]);[color=#000000]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
[color=#00008B]new[color=#000000] [color=#2B91AF]List[color=#800000][color=#000000]([color=#000000]words[color=#000000]);[color=#000000]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
[color=#2B91AF]List[color=#800000][color=#000000]([color=#000000]words[color=#000000]);[color=#000000]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
[color=#000000]([color=#000000]words[color=#000000]);[color=#000000]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
([color=#000000]words[color=#000000]);[color=#000000]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
);[color=#000000]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
This allocates on start around 12mb of storage, iphone has around 43mb I think. So that + textures + sounds + the OS it tends to break.
Speed wise, accessing using a binary search is fine. But its storing it in memory more efficiently (and loading it more efficiently).
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
The text.Split appears to take up alot of heap memory.
Any advice?
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
-> side note, the actual amount of memory isnt too bad once its loaded, but loading it is quite memory intensive. I have tried readline() and by character but those methods are super super slow.
Any advice appreciated.
[/font]
Any advice appreciated.
[/font]
[/font]