Android Question Not enough space for object heap.

nypaulie

Active Member
Licensed User
Longtime User
I'm getting an error when i try to compile. "could not reserve enough space for 4096000KB object heap".
I now have: MaxRamForDev=4000, which is the upper limit, so what's up?
I had been able to Compile/Run with ease until now running B4A in Win-7 (32) in a Linux VBox.
I installed Win-10 in this same VBox and can run B4A fine, but get the same error when compiling.
A reinstall of both VirtualBox and B4A was needed after upgrading my Linux OS. (from Mint 17.3 to 20.2). Could the installation have caused this? B4A seems to work fine, that is up until I want to compile.
 
Last edited:

nypaulie

Active Member
Licensed User
Longtime User
I tried increasing the size to 4100 but that gives an error msg that I've exceeded the limit. Taking it down to 4000 removes that error msg but gives me this one instead.
 

Attachments

  • error.png
    error.png
    260.5 KB · Views: 122
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
In a 32 Bit Windows the MAXIMUM allowed/addressable useable RAM is 4GB. This includes Windows too. Not only the java vm.
So for a b4j app it is much less.

How many Ram does the windows have?

Switch to 64bit Windows and you can use 64, 128, 256GB (if the PC has such big memory.)
 
Upvote 0

nypaulie

Active Member
Licensed User
Longtime User
For years I have been running Windows only when I absolutely need to via Virtualbox on a Linux (Mint 20.2) host. VBox requires that you use the 32 bit Windows versions. After a recent Linux system upgrade from 17.3 I had to reinstall most of my software. This included VirtualBox and Windows. Then I had to reinstall B4A along with the needed files: net, jdk & sdk. Maybe there was something wrong with all of this, although, as I said, B4A appears to be working fine, that is until I try to compile.
 
Upvote 0

nypaulie

Active Member
Licensed User
Longtime User
I ran another compile on a saved older OS to see if the readout looked "different". Here it is. I didn't bother to set up a bridged connection. As to the heap size, thanks for that tip. May I ask how that's done? I will check with Dr. Google meantime. Thanks again.
 

Attachments

  • 17.3.png
    17.3.png
    247.6 KB · Views: 102
Upvote 0

nypaulie

Active Member
Licensed User
Longtime User
Thanks MikeSW17! The link pointed me to my solution. Setting the MaxRamForDex=1500 as someone posted did the trick. Compiling is working on both the Win-7 and Win-10 versions. I went back in and dropped the setting to 1200 as Erel had suggested to the user who found 1500 to work and that worked as well. Did this for "science"... Thanks a million. Worst problems are those that suddenly pop up where they weren't before. Right? Keeps my 83 yr old brain going.
 
Upvote 0
Top