Why does garbage collection work too often in a Windows 10 UWP application?

Why does garbage collection block the UI thread in Windows 10 UWP? (Maybe, but no. But the performance diagnostic tool said that the garbage collector works in the user interface thread) user interface thread lock Also, the application does not respond if garbage collection is running. On Windows Phone 8.1, it works fine and does not cause garbage collection so often. windows 10 UWP garbage collector

update: Updated result from the Diagnostics tool: enter image description here

2 API (1000-2000 2 ). API json. Newtonsoft.Json . , , 1-2 API. PerfView FieldMedic , . Windows Phone 8.1. JITStats 6,734 Windows 10 421 WP 8.1 enter image description here

Windows Phone 8.1 . enter image description here , " Windows UWP 10% ".

3 - . WP8.1 / json. Windows 10 GC.

private void StartButton_OnClick(object sender, RoutedEventArgs e)
    {        
        Task.Factory.StartNew(async () =>
        {
            var storageFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///trips.json"));
            var content = await FileIO.ReadTextAsync(storageFile);
            for (int i = 0; i < 100; i++)
            {
                var trips = JsonConvert.DeserializeObject<IEnumerable<Trip>>(content);                    
            }
        });
    }

: gc_test

+4

All Articles