Ionic barcodescanner App clear memory usage - ios

I'm using barcode scanner on iOS made with ionic. During debug I observe that memory usage keep growing (I saw it on xcode) when the app open the camera to make a scan and after 5 utilisations (5 scans) the app crash with this message : Message from debugger: Terminated due to memory issue.
I've made a lot of searches with nothing satisfying. Can someone know how to avoid the memory increasing or clear it before opening the scanner again ?
Im testing on iPhone 5 / iOS 10.

For those who might encounter this problem I solved it by using a fork of this plugin here https://github.com/jlowe234/phonegap-plugin-barcodescanner.
I include here what was found as the cause of this issue (taken from here : https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/312)
Hello guys, I investigated for this issue and i found the problem on the c++ class. A lot of objects are still in the memory also when barcode viewcontroller is closed (to see the picture below).
So we must delete those files because every time that we open the barcode viewcontroller it takes from 20 to 30 mb so it's a big problem.
I tried to investigate on the C++ code but i don't understand everything so i need of help.
I tested the fork and it's working fine for me. My app stopped crashing and the memory stopped increasing without reason.

Related

Cordova iOS app crashes on multiple upload of files(Reactjs and redux)

IOS app crashes when uploading multiple file(especially those captured in iOS camera).
i created the Cordova project using
Reactjs and Redux
Axios for server calls
the App crashes when there is too much to sent to server side.for eg: App crashed when i upload more than 10 photos at time, but wont have any issue when uploading less than 8 photos.
in Xcode its showing there is a memory pressure and app gets crashed.
So i don't know how to debug this, tried to cut down memory leak by reducing the loops.
but still no hope
has anyone had the same issue or do you guys know how to solve it?
i tried to reduce the memory pressure by cutting down loops.
but still app crashes when uploading more than 10 photos at a time
When i usually implement an application for mobile apps ,
i consider that people are having different mobiles features , it could be high specification or low specifications depend on which mobile you are using , so
my suggestion to you is to make it conditional and do not allow users to select more than 8 files ( since it's working for you ) , and avoid allowing the user to select more because it might be the buffer / ram or it could be network issue / bandwidth issue or internet usage or probably there isn't Enagph ram to process the uploaded photos or it could be internet / network issues / bandwidth / permission issues / libraries issues.
beside that , no one can tell you the exact problem here , you should use any bug tool to find the cause of the issue , i usually use this to debug network requests / response
here is a tested code that works for uploading multiple / photos i hope it can guide to catch the problem .

Why does my Unity ios app's Documents and Data keep increasing?

I created my first app back in July. It came out to be 55mb. I have recently noticed that the Documents and Data section for my app is 150mb, nearly 3 times the app size. Doing more tests I have realized that each time I play the game it increases by 1mb. It is now at 170mb.
I am using Unity 5.6.1p4 and Google Admob.
My app does not download any update files to run the game so that isn't the issue.
I have a couple of guesses but none seem very likely:
1) My game is only about half as optimized as it should be. I still use a lot of instantiate and destroy. An other post said that the memory issue is due to Apple's inability to garbage collect. That is a possibility but I cannot understand why the data from instantiate/destroy would be cached. I also find it hard to believe no one else has had that issue.
2) When the game first starts, it automatically loads a banner ad and a video ad so that there is no delay when the user first requests a reward video. Some people have said that Google Admob caches ads so there is less data usage. That seems like it would cause some increase in file size but 170mb is too much data to be cached. Again I find it hard to believe no one would have complained to Google about this before.
Any help would be greatly appreciated. I cannot figure out what would be causing it. If you are interested in seeing the problem first hand, the App Store link is https://appsto.re/us/nco9gb.i
Ok, here is my findings: This is either an issue for older phones, or iOS 10.x.
However, I do not know which. I am able to test iOS 10 on older phones (5, 5s and ipad 1). I am not able to find any newer device still running iOS 10. This memory glitch does not seem to happen on iOS 11. I was able to test it on 3x iphone 6s, 2x iphone 7 all running iOS 11.It is not as clear as I would like it to be but iOS 11 does not appear to have the memory issue. As much as I would like to find the cause and fix it, I think the majority of people should be safe because they update.

HTTPNetStreamInfo::_readStreamClientCallBack(__CFReadStream*, unsigned long) increases memory allocation

I am trying to download large video file with httpClient post method. I am working Xamarin.iOS, but it seems to be issue of iOS (NSURLConnection/session) as the Xamarin codes convert it into native one.
My device is having IOS8.1. A memory is kept increasing when I try to download that video file up to 300MB. It goes down when its getting completed (if it gets completed before crashing). It crashes most of the time. I am attaching screenshots for the reference.
I found many people having this issue, but no one have the solution, like this link. Did somebody get a chance to fix this issue?
Please let me know if you need more input to understand the issue
Strange but yes, it is fixed in iOS8.3. NSURLCache was broken in iOS 8.x till iOS8.3. So it was not able to clear the cache. But as I have updated it to iOS8.3, it came down to 32KB block and consumes max 5-7MB.

blackberry phonegap app closing after giving an error of being out of memory

I am building a phonegap app for blackberry smartphones. im using phonegap version 1.3.0
in my app, after my first page loads, on a bit of scrolling and exploring, i get a dialog asking me to close the open apps as memory is too low and the only app open is mine. On ignoring that after a minute another dialog comes saying sorry! the memory is too low so closing this app.
also sometimes i get an error saying that the page is too large to load and the page (and the app) is closed.
my app consists of 6-7 pages and only a couple of pages are big and have many images (about 25). can the images be causing a problem? in any case the data downloaded and used does not exceed 5MB.
Can anyone tell me what to do in order to remedy this?
Seems to be a known issue with webworks and certain models of Blackberry phones - See the following thread for a discussion on this specific problem. This is an issue with Some suggestions are to move to Webworks 2.2 but even this does not fix it. (We are facing the same issues as well and hopefully BB fixes it soon).

IPad - Crashing with no apparent reason

I know it's a bit weird but I have no code at all to put here, unless I copy all of it.
My project is crashing with no apparent reason. I've read this solution: iPhone application is crashing and not leaving behind a .crash log file
and I'm using Instrument for searching for leaks and other possibilities for those crashes.
Another strange thing is: even when I run my app with debug on XCode, it just stop to work on my IPad but it looks it is still running.
And the last and more strange thing: there's no crash log at all on my device. Before somebody ask, it is enable to record crash logs.
Does anybody have any idea for helping me?
Regards
I've had this happen to me before on various platforms. If its crashing on you, whether its an iPhone app, openGL / DirectX program, try these steps:
Have you tried to undo your last change and get to the point where it last worked?
Have you tried placing a print outputs to the terminal to see how far your program is executing? Start at the beginning and work your way into your program. This is especially useful when there is no crash log.
Also in particular to iPhone apps: Have you checked your xib's? Did you recently re-factor and change the name of a class maybe? You might need to re-link your nib to your classes. This on more than one occasion has caused apps of mine to crash with no error. Hope this helps.
I doubt you are still wondering about this, but my answer is that you were experiencing your app getting killed by the OS due to using too much memory. This will silently fail in the log in my experience when running on the device.
You will have to go into the Organizer to the device console and crash reports that get stored on the device to see the clues.
The reason your crash stopped when you got an iPad 2 is because the iPad 2 has twice the memory of the iPad 1 (which is dramatically under-stocked with RAM)

Resources