it depends on how much heap you defined for the emulator. if it didnt crash 
with 24mb, you're pretty much safe for 99% of the devices out there (i 
think even 48mb will cover most devices out there)
Otherwise, if you can't figure out a way to reduce your memory allocations, 
just set the largeHeap flag 
(http://developer.android.com/guide/topics/manifest/application-element.html#largeHeap)
 
and cross your fingers.



On Thursday, March 14, 2013 1:18:11 PM UTC+2, karunakar medamoni wrote:
>
> Thanks to everyone.
>
> Am using code which are written by the apertium people. Am just 
> integrating apertium program to my programs. I have increase heap size in 
> emulator some time i did not get any result after that i reduced heap size 
> to middle level at this i got same OOM error. What should i do if i suppose 
> to use apertium in my android application. 
>
> Let we assume that if it works fine when we increase heap size in 
> emulator,later  i will install that  app in some android tablet or phone. 
> how can we increase the heap size in such devices. 
>
>  Why am have to use Apertium ?
>
> Am developing applications which are related to sanskrit languages.Here we 
> can find what exactly am doing .http://sanskrit.uohyd.ac.in/scl/ (web 
> verison) to android platform convertion 
>
>
>
>  Thanks & Regards
>
> M. Karunakar
> University of Hyderabad,Hyd,
> 9491388035.
>
>
> On Thu, Mar 14, 2013 at 1:45 PM, Piren <[email protected] <javascript:>>wrote:
>
>> Actually even 5K can crash his app... it all depends on what he did 
>> before the allocation.
>> Android has a nasty bug of claiming you dont have enough memory even if 
>> your heap has more than enough free space if it grew close to its maximum 
>> value previously (and dont't forget fragmentation as well, 10MB of free 
>> heap doesn't mean you can allocate 10MB).
>>
>> Basically i found that if i get a OOM exception when the allocated size 
>> isn't something  enormous, it's usually because is misbehaved earlier :)
>>
>> So my suggestion to Karunakar (assuming he can't do random reads on the 
>> file and the file isn't really big) is to profile his app and see if he 
>> needs to do some fixing up before he gets to the point of reading the file.
>> Other than that, he can always try the big heap flag or just dump 
>> everything to native heap.
>>
>>
>> On Thursday, March 14, 2013 7:38:56 AM UTC+2, Kristopher Micinski wrote:
>>
>>> how big is the file you're reading..? 
>>>
>>> In general, you can't allocate that much space on Android.  To combat 
>>> this you need to be able to do lazy I/O. 
>>>
>>> But ... are you trying to read in a dictionary (using apertium?).  I'd 
>>> guess this is a few megabytes at least right?  Having a megabyte or 
>>> two on the heap won't necessarily crash your app, but having more than 
>>> that certainly can!  (This of course, depends on the device..) 
>>>
>>> Kris 
>>>
>>>
>>> On Thu, Mar 14, 2013 at 12:49 AM, karunakar medamoni 
>>> <[email protected]> wrote: 
>>> > Hi Richard 
>>> > 
>>> > Good Morning. As per your mail am attaching my android log file. 
>>> Please have 
>>> > look at once. I ran the same program from command line and also in 
>>> eclipse. 
>>> > I got the output , when i try to integrate with android am getting 
>>> this 
>>> > error. 
>>> > 
>>> >  Thanks & Regards 
>>> > 
>>> > M. Karunakar 
>>> > University of Hyderabad,Hyd, 
>>> > 9491388035. 
>>> > 
>>> > 
>>> > On Wed, Mar 13, 2013 at 10:43 PM, karunakar medamoni 
>>> > <[email protected]> wrote: 
>>> >> 
>>> >> Hello Richard 
>>> >> 
>>> >> Thank u for u reply. I will be back  with full stack from LogCat by 
>>> >> tomorrow morning. 
>>> >> 
>>> >>  Thanks & Regards 
>>> >> 
>>> >> M. Karunakar 
>>> >> University of Hyderabad,Hyd, 
>>> >> 9491388035. 
>>> >> 
>>> >> 
>>> >> On Wed, Mar 13, 2013 at 6:11 PM, RichardC <richard...@googlemail.**
>>> com> 
>>> >> wrote: 
>>> >>> 
>>> >>> Can you include the full stack trace from LogCat please. 
>>> >>> 
>>> >>> 
>>> >>> On Wednesday, March 13, 2013 11:37:16 AM UTC, karunakar medamoni 
>>> wrote: 
>>> >>>> 
>>> >>>> Hello 
>>> >>>> 
>>> >>>> Every one. This is karunakar working on android project. Am 
>>> converting 
>>> >>>> apertium based webpage to android app. When i try to run 
>>> >>>> com.apertium.lttoolbox.LTPorc class with two arguments filename.bin 
>>> file and 
>>> >>>> input file am getting this error. If any help from any one it would 
>>> be 
>>> >>>> helpful for me. 
>>> >>>> 
>>> >>>> Here am pasting my code please have a look at once. 
>>> >>>> 
>>> >>>> System.setOut(new PrintStream(new BufferedOutputStream(new 
>>> >>>> FileOutputStream("/data/data/**com.samsaadhani.sandhi1/files/**output"))));
>>> >>>>  
>>>
>>> >>>>                     FileOutputStream fis = openFileOutput("input", 
>>> >>>> Context.MODE_PRIVATE); 
>>> >>>>                     
>>> >>>> fis.write(input.getText().**toString().getBytes()); 
>>>
>>> >>>>                     fis.write("\n".getBytes()); 
>>> >>>>                     fis.close(); 
>>> >>>>                     LTProc.main(new 
>>> >>>> String[]{"/data/data/com.**samsaadhani.sandhi1/files/skt_**
>>> morf.bin","/data/data/com.**samsaadhani.sandhi1/files/**input"}); 
>>> >>> 
>>> >>> -- 
>>> >>> -- 
>>> >>> You received this message because you are subscribed to the Google 
>>> >>> Groups "Android Developers" group. 
>>> >>> To post to this group, send email to android-d...@**googlegroups.com 
>>> >>> To unsubscribe from this group, send email to 
>>> >>> android-developers+**[email protected] 
>>> >>> For more options, visit this group at 
>>> >>> http://groups.google.com/**group/android-developers?hl=en<http://groups.google.com/group/android-developers?hl=en>
>>> >>>  
>>> >>> --- 
>>> >>> You received this message because you are subscribed to a topic in 
>>> the 
>>> >>> Google Groups "Android Developers" group. 
>>> >>> To unsubscribe from this topic, visit 
>>> >>> https://groups.google.com/d/**topic/android-developers/feA_**
>>> XKu8N1o/unsubscribe?hl=en<https://groups.google.com/d/topic/android-developers/feA_XKu8N1o/unsubscribe?hl=en>.
>>>  
>>>
>>> >>> To unsubscribe from this group and all its topics, send an email to 
>>> >>> android-developers+**[email protected]. 
>>> >>> For more options, visit 
>>> >>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>.
>>> >>>  
>>>
>>> >>> 
>>> >>> 
>>> >> 
>>> >> 
>>> > 
>>> > -- 
>>> > -- 
>>> > You received this message because you are subscribed to the Google 
>>> > Groups "Android Developers" group. 
>>> > To post to this group, send email to android-d...@**googlegroups.com 
>>> > To unsubscribe from this group, send email to 
>>> > android-developers+**[email protected] 
>>> > For more options, visit this group at 
>>> > http://groups.google.com/**group/android-developers?hl=en<http://groups.google.com/group/android-developers?hl=en>
>>> >  
>>> > --- 
>>> > You received this message because you are subscribed to the Google 
>>> Groups 
>>> > "Android Developers" group. 
>>> > To unsubscribe from this group and stop receiving emails from it, send 
>>> an 
>>> > email to android-developers+**[email protected]. 
>>> > For more options, visit 
>>> > https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>.
>>> >  
>>>
>>> > 
>>> > 
>>>
>>  -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to 
>> [email protected]<javascript:>
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Android Developers" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/android-developers/feA_XKu8N1o/unsubscribe?hl=en
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to