1

I implemented a Trie tree in Java and it worked fine with a dictionary of about 80,000 words but when I implemented it in my Android app it started to Force Close. I tested it with a dictionary that has only a few words and it worked fine which makes me believe that the size of the dictionary is causing the crash in my Android simulator. Does anyone know why?

zataar
  • 199
  • 1
  • 1
  • 7

1 Answers1

4

Android applications have a limit of 16MB RAM per application, probably you run out of memory. When you do a test on an ordinary computer you do not work in sandbox mood and there is no strict limit on the RAM you can use.

Boris Strandjev
  • 46,145
  • 15
  • 108
  • 135
  • I've just tried the app on my Nexus S and I'm still having the same Force Close problem. Eclipse is telling me it's an Out Of Memory problem. Is there any way around this? – zataar Feb 14 '12 at 02:47
  • See here: http://stackoverflow.com/a/3592323/1108032. Almost all devices have the same RAM limit per application. The only way is to store the whole trie in the flash and load only relevant parts of it in RAM. However, I am confident this will require some reworking on your side. – Boris Strandjev Feb 14 '12 at 07:52