While you can split it up between two applications, remember you only have one processor core, so it'll be a tricky tradeoff to avoid bad performance.
But you have a more immediate problem. 10 MB of UI is clearly broken. My guess is that you have a lot of layout files, and you're inflating them all, and hanging on to them. I haven't closely studied memory usage -- but I don't think you can put anywhere near 10 MB of UI on the screen at once. Now, it may be that the 10 MB is accurate, but it's not really the UI and layout files that are largely to blame; there may even be nothing to do. But I would definitely start with understanding and optimizing your in-memory usage before I start changing the architecture to cross process boundaries. On the data side, you should not be reading in 12 MB of data into memory. As you read it, stick it into a database. You can do this in an async task. The UI would then pull out only the parts of the data that it needs to display at any one time. List views only need to instantiate views for what is shown on the screen at one time. If you have a huge number of subviews, that you switch between, you can do a similar technique, and only instantiate the ones you are displaying, and discard the others -- or maintain a cache. On Mar 22, 2:45 am, Alok Kulkarni <[email protected]> wrote: > Hi guys, > I have an application which fetches data from server and shows it in > different lists in my application. > I used the adb shell procrank command to find out the memory usage of my > application > It takes 10 mb for the UI (I have a single Activity ,but many layout files), > And the data which comes from the server is stored in memory arrays for > logical representation on UI (As well as database)and it takes 6 mb of the > memory .So application's runtime size reaches to 16 mb and then many a > times its crashing after that with OutOfMemoryException. > Another major problem is that later for the next client release , the data > comming from the server will be around 12 mb.. :( :( So i need to do a major > restructuring in the App.I beleive that i cannot increase my App size from > 16 mb to more > So my question here is , can i have two seperate applications , one of which > will fetch the data from the server and keep it in memory as well as > database and another App will be used for showing the UI and it will do an > inter Application communication to fetch the data and display it on the UI > in this App. > So the 1st App wil be a backgrond App which will handle Server communication > as well as data storage , the second App will start this 1st App . > Thanks,Alok. -- 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 To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

