2011/9/5 Károly Holczhauser <holczhau...@gmail.com>:
> Hello girls and boys!
>
>  I'm going to describe my problem as short as I can and would like to
> give a thanks for any advice, tips and so on :)
>
> So, I had wrote an really complex News reader application which one is
> able to:
> -read news and articles
> -save and load them
> -able to save galleries and load them
> -able to download online mp4 video files and play them to the user
>
> My problem is the following: don't have enough memory:) Seriously,
> when the I use the program long time ago, watching some video and
> articles I got an out of memory error. Sometimes it is an
> "java.lang.OutOfMemoryError: bitmap size exceeds VM budget" sometimes
> it is just an "out of memory, vm don't allow to alloc xy byte".
>
> I had tried a lot of thing to make memories free:
> - clear the cache on the sdcard
> - disable webviews cache (I'm using webviews to display articles)
> -catch the OutOfMemoryError and call System and Runtime gc
>
> None of above was help to me. I haven't got any another idea, so had
> started to use MAT (Memory Analyser Tool) and I had seen there two
> types of object witch are the biggest memory custromers:
> android.webkit.webHistortyItem and a Linearlayout.
>
> I don't use webHistorty in the app, only webviews, but I had set the
> usercache=false . How can I make webHistortyItem clear?

Use WebView.clearHistory()

> Linearlayout ? Of course I'm using a lot, but I have no idea where I'm
> forget to make it null. How can I find it? Are the Linear-layout and
> the Bitmaps using the same memory or they are getting to store in
> absolutely independent area of it ?

How are you launching your activities (I mean in which mode)? Playing
with that could change your memory usage drastically, but will also
alter the way your app works.

>
> is anybody have any idea about it? How should I make memory free?
>
>  Thank you , Karoly


I think there is a deeper issue with your app. If you have mostly/only
web-views, seems like all you need is a web-app, with mobile styling.
That could give you access to Android as well as other mobile
platforms. I understand that you are saving some session data on the
device (read articles, subscriptions, ...), but you could achieve that
saving user sessions and preferences on the server side.

Or you have to re-think and re-architect your app, if you come to
conclusion that your app must be native.

-- 
Daniel Drozdzewski

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to