OutOfMemoryException exposed or caused by SlideView

16 posts, 0 answers
  1. Alexander
    Alexander avatar
    12 posts
    Member since:
    Feb 2013

    Posted 16 Feb 2013 Link to this post

    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?
  2. Alexander
    Alexander avatar
    12 posts
    Member since:
    Feb 2013

    Posted 16 Feb 2013 Link to this post

    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).

  3. DevCraft banner
  4. Todor
    Admin
    Todor avatar
    778 posts

    Posted 21 Feb 2013 Link to this post

    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.
  5. Alexander
    Alexander avatar
    12 posts
    Member since:
    Feb 2013

    Posted 13 Mar 2013 Link to this post

    Any update on this?
  6. Todor
    Admin
    Todor avatar
    778 posts

    Posted 14 Mar 2013 Link to this post

    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.
  7. Todor
    Admin
    Todor avatar
    778 posts

    Posted 14 Mar 2013 Link to this post

    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.
  8. Alexander
    Alexander avatar
    12 posts
    Member since:
    Feb 2013

    Posted 15 Mar 2013 Link to this post

    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.
  9. Todor
    Admin
    Todor avatar
    778 posts

    Posted 19 Mar 2013 Link to this post

    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.
  10. Alexander
    Alexander avatar
    12 posts
    Member since:
    Feb 2013

    Posted 19 Mar 2013 Link to this post

    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.
  11. Todor
    Admin
    Todor avatar
    778 posts

    Posted 19 Mar 2013 Link to this post

    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.
  12. Alexander
    Alexander avatar
    12 posts
    Member since:
    Feb 2013

    Posted 22 Mar 2013 Link to this post

    Hi, any update on when the build will be available?
  13. Todor
    Admin
    Todor avatar
    778 posts

    Posted 22 Mar 2013 Link to this post

    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.
  14. Alexander
    Alexander avatar
    12 posts
    Member since:
    Feb 2013

    Posted 22 Mar 2013 Link to this post

    I'll give it a try, thanks.
  15. Alexander
    Alexander avatar
    12 posts
    Member since:
    Feb 2013

    Posted 24 Mar 2013 Link to this post

    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.

  16. Alexander
    Alexander avatar
    12 posts
    Member since:
    Feb 2013

    Posted 24 Mar 2013 Link to this post

    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.


  17. Todor
    Admin
    Todor avatar
    778 posts

    Posted 27 Mar 2013 Link to this post

    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.
Back to Top
DevCraft banner