Android Question Available memory

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi to everybody here. I am facing the memory management problem. I am using the GetFreeMemory found on this site. I have various tablets, with different ram, namely 3gb, 4Gb or 8+8 Gb. When I run the App, the GetFreeMemory always gives 500 Mb, with all tablets. Setting a LargeHeap option in the manifest, doubles the free memory (but the value I reported is already with LargeHeap option set). Btw LargeHeap option, on 3Gb tablet, doesn't allow to run my OpenGl based App. There are actually some differences, in OpenGL behaviour, but I cannot quantify the differences. Anyway, the question is: if I buy tablets with more Ram, the available memory will remain the same? (As it seems to indicate the results of my tests).
Thanks for any hint.
 

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Good morning. I have a map containing some elements of tyoe:
B4X:
Type VertexData(changed As Boolean, vertexList As List, vertexArray() As Float, beginIndices(4) As Int, endIndices(4) As Int)
The presence of the vertexArray is due to the fact that it contains floats that are passed to OpenGL. vertexArray contains lines, that is four coords per line (2D) and may contain some millions lines. I would like to save and restore the map to avoid the time consuming process of building the vertexArray. In another post of mine, concerning saving an array of floats, I described better the situation.
 
Upvote 0

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Ok. Thanks. I will open another thread for another question, that I have met during the new process. Thanks a lot.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
When I run the App, the GetFreeMemory always gives 500 Mb, with all tablets.
This could be the result if the program is started with the same configurated memory size not based on the availible memory in that device.
Anyway, the question is: if I buy tablets with more Ram, the available memory will remain the same?
I think that you run against the rule that for client JVMs (e.g., Java Runtime Environment), the defaults conservative memory allocating is around 256 MB maximum heap size if the system has 1 GB or more RAM.

The fact that you are getting memory error messages is not the major memory problem, but a symptom of another challenge: your program design uses a lot of memory or you have suffered from a memory leak.

As Erel wrote:
As you wrote in the other thread, the solution is to serialize it in multiple parts.
My advice is to check with your new design whether you can use a database with your new solution. Using a database has the advantage that memory management is a part that is taken care of by the database.
 
Upvote 0
Top