You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The app works beautiful when I use it on Emulator. It also works perfectly when I deploy from Visual Studio to the device
But my problem started only when I install the app from Google Play.
The problem is like this..
I have a rotator in the home page populating data from SqlServer's SqlConnection and this part is working fine but when I open any second page which has data fromSqlConnection then the app will crash with this error in AppCenter:
AppCenterLog.Error (System.String p0, System.String p1)
Java.Lang.OutOfMemoryError: Failed to allocate a 5118169368 byte allocation with 6291456 free bytes and 509MB until OOM, max allowed footprint 9207128, growth limit 536870912
O
opening static pages has no issue but it's only when opening pages with SqlConnection such as news page (see the icon for guide)
You can try downloading the app from Google Play and click on any of these icons and the app will crash
I'm guessing the error is shown as happening on some device for some user who downloaded the app? Do you know what the device is? Would you be able to test it personally? In general, the problem is that something in your application tries to allocate nearly 5GB of RAM which is unlikely to work in most cases. Unfortunately, the information you provided is not sufficient to see where the allocation happens. If you can get a full stack trace of the OOM crash and, ideally, a logcat of the failed session then we might be able to figure out what is going on. We don't know if the allocation is attempted in Java or .NET code, the trace mentioned before would be necessary to determine that.
Please provide the requested information and we'll try to figure out the issue, thanks!
hi @jrahma, the sample code looks almost innocuous, indeed. However, the Convert.ToString calls have at least he potential of runaway allocation (should sqlite be buggy, database corrupted etc) since it appears to be a single, big allocation attempt. Can you add some Console.WriteLine statements before and after those lines to see where exactly the exception is thrown? It might be a good idea to surround every line potentially allocating memory with Console.WriteLine - that way we should be able to see in logcat at least what's the sequence leading to the OOM.
@jrahma looking at your stack trace we noticed that there's a FragmentContainer implementation in your app - do you do any large allocations in a subclass of it? Also, some questions:
Is your emulator 64-bit or 32-bit?
Is your emulator x86 or ARM?
Are the devices you tested on 32-bit or 64-bit?
Does your app have 64-bit targets enabled?
The huge allocation size might be result of signed to unsigned integer conversion, something similar to:
inti=-1;uintj=(uint)i;
Which would yield the value of 4294967295 in j - if then that value is added to some ulong or long, it may very well result in the 5GB allocation we're seeing.
Activity
grendello commentedon Jul 18, 2019
Hi Jassim,
I'm guessing the error is shown as happening on some device for some user who downloaded the app? Do you know what the device is? Would you be able to test it personally? In general, the problem is that something in your application tries to allocate nearly 5GB of RAM which is unlikely to work in most cases. Unfortunately, the information you provided is not sufficient to see where the allocation happens. If you can get a full stack trace of the OOM crash and, ideally, a logcat of the failed session then we might be able to figure out what is going on. We don't know if the allocation is attempted in Java or .NET code, the trace mentioned before would be necessary to determine that.
Please provide the requested information and we'll try to figure out the issue, thanks!
jrahma commentedon Jul 18, 2019
I tried it so far on Honor Lite 10 (my device) and Mate 20 Pro (another user device) and both are giving the same problem.
and as I said it's working perfectly when I just deploy the apk on my device locally (the same Honor 10 Lite) or run it on emulator
This is a sample code which I don't think it should consume 5GB!
jrahma commentedon Jul 18, 2019
This is from AppCenter:
grendello commentedon Aug 20, 2019
hi @jrahma, the sample code looks almost innocuous, indeed. However, the
Convert.ToStringcalls have at least he potential of runaway allocation (should sqlite be buggy, database corrupted etc) since it appears to be a single, big allocation attempt. Can you add someConsole.WriteLinestatements before and after those lines to see where exactly the exception is thrown? It might be a good idea to surround every line potentially allocating memory withConsole.WriteLine- that way we should be able to see in logcat at least what's the sequence leading to the OOM.grendello commentedon Aug 20, 2019
@jrahma looking at your stack trace we noticed that there's a
FragmentContainerimplementation in your app - do you do any large allocations in a subclass of it? Also, some questions:The huge allocation size might be result of signed to unsigned integer conversion, something similar to:
Which would yield the value of
4294967295inj- if then that value is added to someulongorlong, it may very well result in the 5GB allocation we're seeing.jonathanpeppers commentedon Sep 23, 2019
@jrahma closing for now as we haven't heard back in a while.
If you know the answer's to @grendello's questions we can look into it further, thanks!