locked
Fetching large byte array from database and displaying in control issue in windows 8 RRS feed

  • Question

  • Hi Forum,

                   We have a windows 8 app in xaml & C#. In our app user can store images of any size. We stores those images in sqlite database. But we have an issue now. If user saves 4 or 5 large images of size more than 3 mb, the code begin to throw debugger error. We are fetching the byte array from database and loading it to bitmapimage and then showing images in gridview. Please tell me how can I solve this type of issue in my app?


    Dinesh Rawat Sr. Software Consultant Windows Phone-WinRT-Silverlight MCTS Silverlight

    Tuesday, September 10, 2013 11:13 AM

All replies

  • Hi Dinesh,

    I'd like to ask some questions for knowing a detail scenario.

    What kind of debugger error has been thrown?

    Is the error only fires when the single image size is bigger than 3MB?

    If the image exist in the Database, will the same error occurs while fetching them?

    By the way, why not save the images in a local folder and use sqlite database record the image path.

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, September 11, 2013 3:29 AM
    Moderator
  • Hi Jamles,

                   The error was coming if the list has more than 3 images of large size. If I saves the image one by one than it saves to database but after that if I refreshed the list it begin to slow and a debugger error thrown. We cannot save the images in the local drive, it's the policy of our app to provide a user security for their secret images. If my database has 10 images of size 5 mb. That means total size is 50 mb. The size of bytes will be 50 mb. When I fetches that bytes from database one by one in a list then converts the bytes in bitmap. Is this process causing any out of memory issue?


    Dinesh Rawat Sr. Software Consultant Windows Phone-WinRT-Silverlight MCTS Silverlight

    Wednesday, September 11, 2013 11:06 AM
  • Hi Dinesh,

    Normally use GridView to hold images will leave the images stay in the memory and the memory limitation is the problem causing the debugger error. For suggestion you could use VirtualizingStackPanel to help improve the performance, I'm not sure if this is the solution for your question.

    And can you post the Debug Error message to us for a better support? I talked with our senior engineer with your issue this morning, without the debug error message they can hardly determine what kind of issue you are facing.

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, September 12, 2013 4:11 AM
    Moderator
  • Hi Dinesh,

    Can you share a sample application with dummy images that replicates the issue ? 

    -Sagar


    Thursday, September 12, 2013 10:28 AM