(03-21-2015, 03:59 PM)magumagu Wrote: Yes, it actually wants 16GB. The fact that we free it immediately is a bug. Note that it isn't actually allocating that much memory, just trying to reserve address space for fastmem. This hasn't been a problem on desktop OSes or Android; not sure why iOS doesn't like it.
If reserving the address space is really impossible on iOS, we'll need to modify the JIT to compensate for a different memory layout. Not impossible, but there would be a substantial performance penalty.
I looked more into this issue, and apparently iOS does limit the amount of addressable memory. Somebody made a program that attempts to exhaust the addressable memory and found the limit of how much a process can take. If you run it in the simulator, there are no restrictions. However, on the actual devices, there are restrictions and they vary with each device. The highest amount he got was on the retina iPad Mini (that is 64-bit), which was around 2GB! Presumably, this amount would be even less for iPhones!
So, from here, I could maybe try using setrlimit since we have access to root on a jailbroken device, or the only option is to modify the JIT as you said...
UPDATE: getrlimit(RLIMIT_AS) says it's already set to the maximum value...