Out of memory on dalvikvm

Put your problem here if it does not fit any of the other categories.

Out of memory on dalvikvm

Postby tsdt » Sat Jan 19, 2008 7:56 pm

I am coding Dictionary, the function Readfile return the String[110000] to keyword,so the keyword is the array of String such as {"a","an","b","be","been",...} (words in Dictionary,about 108000 words)
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. String[] keyword = new String[110000] ;
  3.  
  4. keyword = Readfile("eng-viet109K.txt");
  5.  
  6.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


i met a problem in the dalvik VM like this:

E/dalvikvm-heap(585): Out of memory on a 62-byte allocation.
E/dalvikvm(585): VM aborting


I do not know how to expand or change the dalvik VM configuration.
May be the quatity of words is too much?(My database txt file include 2 file: eng-viet.txt (1.9Mb) and eng-viet.res(4.4Mb))
Please help me!

THANK YOU !!!
TSDT
tsdt
Junior Developer
Junior Developer
 
Posts: 12
Joined: Wed Jan 09, 2008 4:20 am
Location: VIETNAM

Top

Postby plusminus » Sat Jan 19, 2008 8:16 pm

Hello tsdt,

hm, you have
Lets say you have an average of 7 chars per entry, what means 14 bytes of info (because of unicode) + 4 bytes of string-lenght-information.
This results in 18 Bytes * 110000 Entries ~ 2MB of data :!:
So you should think about loading only the relevant parts of your dictionary. Perhaps splitting to smaller parts already helps.

For comparison, the total Heap-Size of my PizzaTimer is just 1,5MB. (watch it in the DDMS-View (click "update HEAP" on the specific process))

Btw, there is an issue about Androids Garbage-Collector which is said not to work properly. (so perhaps it is not your fault)

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 16 guests