B4J Question How to increase Heap Space?

cyiwin

Active Member
Licensed User
Longtime User
I'm really enjoying B4J!

My app runs for about an hour before it dies with this error.
java.lang.OutOfMemoryError: Java heap space

I've followed the instructions from this website to increase my heap space to 1GB but according to VisualVM I'm still throttled at 268MB.

I've also found this website that tells me to "use the cmd-line flags" and enter "java -Xmx6g myprogram". This may be a silly question but does any one know where these cmd-line flags are?
 

NJDude

Expert
Licensed User
Longtime User
Try adding this line to your manifest:
B4X:
SetApplicationAttribute(android:largeHeap, "true")
Note that this only works on Android version > = 3 (SDK 11)
 
Last edited:
Upvote 0
Top