Android Question System Out of Memory

Pedro Caldeira

Active Member
Licensed User
Longtime User
Hello All,
I constantly get this error, I know the APP is big, with hundreds os activities, classes, modules, etc and each one with several thousand lines of code, but I am working, just coding, and I get this error all the time. The picture shows it while compiling, but I also get it while coding in the IDE. My laptop is a Lenovo Thinkpad with 16Gb of Ram.
And it take forever to compile, about 5 min avg.
Any Ideas ?
 

agraham

Expert
Licensed User
Longtime User
System.OutOfMemoryException is a .NET Framework error. If your app is really that large it might just be that the IDE is running out of memory. I assume you have a 64bit OS but B4A is a 32bit program so can only use up to 4GB of memory so I can possibly see it running out of memory when compiling but it's a bit odd that it happens when editing. I know Erel is considering switching the B4X IDEs to 64bits but I don't know if he has a timescale for doing it - but that is no help to you.

Have you another machine you can try it on to see if that suffers the same problem with that app?
 
Upvote 0

Pedro Caldeira

Active Member
Licensed User
Longtime User
Yes, I have a collegue with the exact same problem. His laptop as also 16GB.
It never occurred to me that the B4A could be a 32Bits program. That explains it. I can only hope Erel doesn't take too long to switch the IDE to 64Bits.
 
Last edited:
Upvote 0

aeric

Expert
Licensed User
Longtime User
I experienced compilation timed out issue and the IDE “eat up” a lot of resources (CPU and RAM) before. My brother accidentally shutdown my windows while my IDE is opened. This has caused corrupted files. After I reinstall the IDE, everything has backed to normal.
 
Upvote 0

Pedro Caldeira

Active Member
Licensed User
Longtime User
It is not the issue that I am experiencing, however. But thanks for the input.
 
Upvote 0

LuigiTasca

Member
Licensed User
Longtime User
I have the same problem, 16BG RAM computer and a huge project. Actually, when I compile my progect and I get "system out of memory", my RAM is not fully used. Everytime I do changes on my code ad I compile, I have to close and re-open the project before I can compile again. I considered to create a library of some modules, but I have to edit them often (surely I'll have to compile them in the future). If switching the B4X IDEs to 64bits solves this, I look forward the update

Kind regards
 
Upvote 0

Pedro Caldeira

Active Member
Licensed User
Longtime User
Hello, I suffer from exactly the same problems you have described. Also waiting for the 64 Bits version.
 
Upvote 0

Lariliss

Member
Would you check if one of these applies.
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Its been 3 days with some stability, my laptop has 8GB ram, then I was curious. So i found the ini file and set

MaxRamForDex=5120

and in all my b4j apps I have added, #VirtualMachineArgs: -Xms2G -Xmx2G

and instead of out of memory errors every now and again, they seldom happen, especially when I open the abstract designer. I also noted that when I dont use File > Recent files to open a new project, closing B4J and then opening it helps. Yes ram usage jumps to 1G on the task manager within 5 seconds of opening my library.

From time to time I close and restard the IDE as the keyboard lag in the IDE just becomes a headache. Why the out of memory errors have decreased? I dont know. They happen, but not as often as before, maybe its this or something else, I dont know.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…