Forum Xamarin Xamarin.iOS

SGen/RefCount in

JahmaiJahmai AUMember ✭✭

In the release notes for it says that both the SGEN garbage collector and RefCount features a no longer experimental, but the Xamarin Studio UI still lists them as being experimental.

Is this just a UI bug that will be fixed in the next Studio update?


  • SebastienPouliotSebastienPouliot CAXamarin Team Xamurai

    Yes. The UI is part of the iOS addin that is shipped with Xamarin Studio.

    IOW you'll need a very recent XS build to have the correct string description (which will vary depending on which Xamarin.iOS version you're using).

  • victoriavictoria SEMember ✭✭✭

    So... I'm just about to release a new version of a somewhat successful app when I too read in the release notes that sgen is no longer considered experimental.
    For someone who's not really keeping up with what happens in compiler land this option just went from a solid "ah, it's experimental - let's not touch that" to a confused "okay, now what?"

    QUESTION: Should we tick the sgen checkbox when we do our release build then? what about ref-count?

  • SebastienPouliotSebastienPouliot CAXamarin Team Xamurai

    Hello @victoria‌,

    Standard Disclaimer: We're talking about software so never change global settings without fully re-testing your application :-)

    sgen support for iOS is older than Xamarin itself. Xamarin.Android only uses sgen (since it depend on some extension to co-exists with the Java-side GC). There were a few things that we wanted to complete before removing the experimental flag. There was no need to rush it (there so many things to do :-) since we already had a working GC.

    The New-Refcount extension is not experimental anymore but it's still not considered stable. In fact when it become stable it will likely be the new default mode (at least for new applications).

    As of today there are no known bugs on it, a lot of testing was done on the extension and we went back to most of the bug reports dealing with memory management to see if it fixed the issues (the one we expect it to fix).

    Still it's a change to memory management. Some instances will live longer than before (not a bug, it's because they are still needed). That might affect the total memory usage for some applications. OTOH the removal of most backing fields means each instances (every NSObject) is smaller than before - so it takes less memory.

    YMMV about how the longer-lived, but smaller instances will affect your application. I believe it won't be visible for most applications, it will help some but it might affect a few of them (e.g. if they were already very memory constrained).

    QUESTION: Should we tick the sgen checkbox when we do our release build then? what about ref-count?

    IMHO both options will be beneficial to most applications. If you have a good test suite, a good QA team/plan, some baseline statistics (e.g. memory) and the time to go thru them then I would not hesitate.

    OTOH if you're short on time, have no baseline or test suite then it might not be a good idea (unless you know it will fix issues you're currently facing). In that case you should wait for a better time (and acquire the data, build a test suite...) before switching settings.

    Also please let us know if you switch options and see any (or no) difference(s) in your application. Such feedback is very helpful to us :-)

Sign In or Register to comment.