Find Maximum VM heapsize

touchsquid

Active Member
Licensed User
Longtime User
I have a large app which needs at least 32 MB heap size to work. Is there a function I can call from B4A to get the maximum VM heapsize?

I posted this on Stack Overflow with no results.

:sign0188:
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This code returns the JVM maximum heap size:
B4X:
   Dim r As Reflector
   r.Target = r.RunStaticMethod("java.lang.Runtime", "getRuntime", Null, Null)
   Dim maxMemory As Long
   maxMemory = r.RunMethod("maxMemory")

I posted this on Stack Overflow with no results.
Are you sure that you used the basic4android tag? I didn't see your message.
 
Upvote 0

touchsquid

Active Member
Licensed User
Longtime User
Thanks Erel, exactly what I needed.

Maybe I forgot the tag.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…