This is a migrated thread and some comments may be shown as answers.

OutOfMemoryException exposed or caused by SlideView

15 Answers 134 Views
SlideView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alexander
Top achievements
Rank 1
Alexander asked on 16 Feb 2013, 04:51 PM
Hi,
I created a sample app:
https://dl.dropbox.com/u/16063542/TestSlideView.zip

In order to reproduce OutOfMemoryException: 

- start app, go to the first portion of images by pressing button "1". You'll see the SlideView with 100 images. Use Filmstrip mode to scroll to the last image. Go back
- Do the same for pages "2", "3", "4", "5".

Do it 3 times (i.e. scroll through all 500 images 3 times) --> application will crash.

---
So, there is an obvious memory leak. Any ideas of how this could be solved?

15 Answers, 1 is accepted

Sort by
0
Alexander
Top achievements
Rank 1
answered on 16 Feb 2013, 04:55 PM
A, forgot to mention that I was using Nokia 710 for testing. So, on other phones it might take extra time to get the exception (it takes appx 5-10 minutes on mine).

0
Todor
Telerik team
answered on 21 Feb 2013, 09:30 AM
Hi Alexander,

Thank you for writing us.

Using your application, I was able to reproduce the described issue. We will need more time to further investigate what exactly is the cause.

I have updated your Telerik points for your cooperation.

Greetings,
Todor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Alexander
Top achievements
Rank 1
answered on 13 Mar 2013, 07:16 PM
Any update on this?
0
Todor
Telerik team
answered on 14 Mar 2013, 07:47 AM
Hi Alexander,

Later today we will release an internal build that will contain a fix for the reported issue. After you start using the new binaries from the internal build, the application should be working as expected.

All the best,
Todor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Todor
Telerik team
answered on 14 Mar 2013, 11:16 AM
Hello,

Just wanted to let you know that the build is already uploaded and you can get it from the Latest internal builds section.

Kind regards,
Todor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Alexander
Top achievements
Rank 1
answered on 15 Mar 2013, 03:30 PM
I downloaded latest dlls from here http://www.telerik.com/account/your-products/internal-builds.aspx?type=2&mvid=3148&pid=777
and I'm still able to reproduce the same problem.
0
Todor
Telerik team
answered on 19 Mar 2013, 07:12 AM
Hello Alexander,

We have made some improvements on this subject, but unfortunately it seems that for your application they only delayed the occurrence of the crash. We went through our code again and now the memory leak issue seems to be resolved. The latest changes will be included in our next internal build that we will release later this week. Apologies for the delay and thank you for understanding.

Kind regards,
Todor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Alexander
Top achievements
Rank 1
answered on 19 Mar 2013, 12:31 PM
Ok, looking forward to that.
Meanwhile I was looking into the way to use so called LowProfileImageLoader with SlideView. In my mind this would solve memory leak as well.

I was able to do it, sort of. This exposed another issue: image blinking after swipe gesture. After looking in the code of SlideViewPanel, I see that in Default realization mode it maintains three containers for items. When moving to the next image these containers are not rearranged, instead they are rebound. 
Wouldn't it be much better approach to rearrange them?
(1,2,3) -> {swipe to next) -> (2, 3, 1) -> {swipe to next} -> (3,1,2)
Now they always stay (1,2,3).

Unless I'm missing something, this should be fairly easy to do.
0
Todor
Telerik team
answered on 19 Mar 2013, 01:18 PM
Hello Alexander,

We are aware of this blinking and it can be easily avoided by setting the CacheMode property in RadSlideView to BitmapCache. However, your thoughts seem reasonable. We will discuss the proposed changes along the team and after some testing of the possible performance improvements we will decide whether to change the way the items are arranged for some of our future releases.

Thank you for your time.

All the best,
Todor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Alexander
Top achievements
Rank 1
answered on 22 Mar 2013, 01:00 PM
Hi, any update on when the build will be available?
0
Todor
Telerik team
answered on 22 Mar 2013, 01:12 PM
Hi Alexander,

The build is already available and you can download it from your account. Just go to the Latest internal builds section and choose the 2013_1_0322_DEV_hotfix version.

Greetings,
Todor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Alexander
Top achievements
Rank 1
answered on 22 Mar 2013, 03:07 PM
I'll give it a try, thanks.
0
Alexander
Top achievements
Rank 1
answered on 24 Mar 2013, 12:07 PM
Hi,
unless I misunderstand something, memory leak is still there. 
//if (System.Diagnostics.Debugger.IsAttached)
           //{
               // Display the current frame rate counters.
               Application.Current.Host.Settings.EnableFrameRateCounter = true;
 
               MemoryDiagnosticsHelper.Start(TimeSpan.FromMilliseconds(500), true);
Comment 'if' statement in my test app, app.xaml.cs. and see how memory usage grows as you go back and forth between main page and page with images and between images. It just takes a little bit more time to make the app crash.

I'll try to look for solution myself. Current situation is not acceptable for my app.

0
Alexander
Top achievements
Rank 1
answered on 25 Mar 2013, 12:20 AM
Ok, I was able to make a workaround which prevents memory leak.

https://dl.dropbox.com/u/16063542/TestSlideViewFIXED.zip

Notice that I use LowProfileImageLoader, which downloads image 'manually' and loads BItmapImage from Stream. This ensures there is no in-memory caching of the bitmap.
Using LowProfileImageLoader adds two problems:
- blinking when swiping. Solved by using RealizationMode=Viewport
- image not correctly resized on double tap. Solved by overriding OnDoubleTap.


0
Todor
Telerik team
answered on 27 Mar 2013, 12:48 PM
Hello Alexander,

I'm happy to see that you now you have your project running and without any memory leaks.

If you stumble upon other issues, we will be happy to assist you.

Regards,
Todor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
SlideView
Asked by
Alexander
Top achievements
Rank 1
Answers by
Alexander
Top achievements
Rank 1
Todor
Telerik team
Share this question
or