Forum Xamarin.iOS

Xamarin iOS app uses 750 file handles on iOS 12 simulator, only 250 on iOS 13 simulator, why?

I have a Xamarin iOS app that runs on both the iOS 12 simulator and iOS 13 simulator. I am using Visual Studio Professional to launch a simulator on a paired Mac. The Mac has iOS 12.0 simulators and iOS 13.3 simulators. When I debug my application on the iOS 12 simulator, I quickly run out of file handles after downloading a bunch of files via HttpClient; whereas on iOS 13 I do not.

Running lsof via a Process.Start indicates that there are around 750 file handles open on debugging start on iOS 12, whereas on the iOS 13 simulator there's only 250 file handles. The file handles that appear on iOS 12 and not 13 are these 'iOS 12.0.simruntime' files as seen below:

I am seeing file handle exhaustion in our release application as well on iOS 12 so I believe the issue is not just debugging related. I'm stumped as to why all these files are open on debugging for iOS 12 but not 13.

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    I noticed lots of these files are system foundation frameworks. They still need to be loaded even though you haven't made something using httpclient.
    How many files do you need to manipulate when downloading finishes? Did you test this on the same series device?
    I suspect this could be a memory issue if you hold too many files at the same time.

  • EdwardGiardinaEdwardGiardina USMember ✭✭

    @LandLu said:
    I noticed lots of these files are system foundation frameworks. They still need to be loaded even though you haven't made something using httpclient.

    Ok, but why are these foundation framework files loaded on iOS 12 but not on a simulator running iOS 13.3?

    How many files do you need to manipulate when downloading finishes? Did you test this on the same series device?
    I suspect this could be a memory issue if you hold too many files at the same time.

    Yes, I tested on a series of devices. See my original post where I mention iOS 12 and iOS 13.

  • LandLuLandLu Member, Xamarin Team Xamurai

    How did you record these files from the device?
    I suggest opening a free support ticket here:
    https://support.microsoft.com/en-us/supportforbusiness/productselection?sapId=211dd84f-3474-c3c5-79bf-66db630c92a6
    as I haven't encountered this before. It could be device-related.

Sign In or Register to comment.