4future_cuber
4future_cuber

Reputation: 11

java RAM problems

I've a problem with my android. First I wrote an application in C language (for PC), which used lot of RAM - about 500 MB for tables. Then I tried to rewrite the same code for Android in Java (Eclipse)... and the problems started.

It has taking a lot of time to create (on htc desire hd) static tables (the same size = 500MB) - first I think that is working but...then somebody told me that single aplication on Android can only use 24 MB RAM. it is true? How can I make this size bigger? How can I solve this restriction?

Upvotes: 1

Views: 218

Answers (3)

Astronaut
Astronaut

Reputation: 7041

You clearly need to design your Android client in a way that can consume services. Your phone is not supposed to be used as a service provider (database server).

I would recommend you do all your database work on the server side and simply query and present the data on your Android (client). The least amount of processing you do on your phone the better, since these are presentation devices (battery constrains, limited amount of memory and processing power, etc.) not data/number crunching devices.

You can raise the limit to 48Mb in certain devices (tablets) by using a configuration option witch i do not remember but is in the documentation, but is not recommended.

Upvotes: 3

piotrpo
piotrpo

Reputation: 12636

Yes it's true. You have to optimize your code (use flash memory to store some data) or just use external server for running your algorithms.

Upvotes: 1

Chris Dennett
Chris Dennett

Reputation: 22721

Most phones don't even have 500+MB of RAM, and even if they did, Java structures take up far more space than C structures (object overheads). What are you trying to achieve? You can't solve the restriction. Instead, use a more efficient data structure.

Upvotes: 5

Related Questions