06-20-2019, 01:17 AM
If your device runs out of memory and has to perform frequent garbage collection as a result, that certainly could cause delays. At a certain point, you shouldn't see MobileSheets consume additional memory. When a new song is selected, I do free all of the memory used for PDFs that were loaded, but I keep the buffers that were allocated for images in memory to prevent frequent allocations and deallocations. This is extremely important because huge stutters can occur if garbage collection has to occur on large blocks of memory. This was one of things I tried to improve a number of updates ago to see if it would help users with the performance issues they encountered. The buffers for each image should match the number of pixels used for the pages that are displayed. If your songs were stretched to the fill the screen and the surface pro 4 is 2736 x 1824 and I buffer 14 images max in memory, that is 19961856 bytes per buffer (~20 MB), so 280 MB max. I also use WriteableBitmap objects, which allocate the same amount of memory each, but these have to be allocated/deallocated when switching songs. So MobileSheets can easily use around 600 MB, but it shouldn't keep climbing, as it's a limited size memory pool.
Having said all that, I'm switching to Win2D with the annotations rework, which is going to help reduce the memory usage needed (as I will no longer need to use WriteableBitmap objects), and could also help performance due to less allocations/deallocations. I don't know if this will fix the delays you are seeing, but it may.
Do you only notice these delays after MobileSheets has been running awhile, or does it even happen after first loading it? If you completely close down MobileSheets and restart it, does it work better for awhile or not? I ask because with my development and testing, the application is being restarted a lot and usually hasn't been left running for long periods of time. I sometimes will take it out of sleep after several hours and test things, and I don't see the long delays doing that, but I want to see if this has anything to do with why I'm not seeing this issue on my Surface Pro 4.
Thanks,
Mike
Having said all that, I'm switching to Win2D with the annotations rework, which is going to help reduce the memory usage needed (as I will no longer need to use WriteableBitmap objects), and could also help performance due to less allocations/deallocations. I don't know if this will fix the delays you are seeing, but it may.
Do you only notice these delays after MobileSheets has been running awhile, or does it even happen after first loading it? If you completely close down MobileSheets and restart it, does it work better for awhile or not? I ask because with my development and testing, the application is being restarted a lot and usually hasn't been left running for long periods of time. I sometimes will take it out of sleep after several hours and test things, and I don't see the long delays doing that, but I want to see if this has anything to do with why I'm not seeing this issue on my Surface Pro 4.
Thanks,
Mike