Getting out of memory exception while loading images in web browser control one by one in windows phone 8 silverlight application?

Hi, 
I am developing a windows phone 8 silver light application . 
In my app I am displaying images in web browser control one by one , those images are the web links , the problem is after displaying 2 to 3 images I am getting out of memory exception .
I searched for this exception how to over come , everybody are saying memory profiling ,..etc but really I dont know how to release the memory and how to clear the memory .
In some sites they are adding this
<FunctionalCapabilities>
<FunctionalCapability Name="ID_FUNCCAP_EXTEND_MEM"/>
</FunctionalCapabilities>
by doing this am I free from out of memory exception?
Any help ,
Thanks...
Suresh.M

string HtmlString = "<!DOCTYPE html><html><head><meta name='viewport' content='width=device-width,initial-scale=1.0, user-scalable=yes' /></head>";
HtmlString = HtmlString + "<body>";
HtmlString = HtmlString + "<img src=" + source +" />";
HtmlString = HtmlString + "</body></html>";
innerpagebrowser.NavigateToString(HtmlString);
that image source is the web link for example www.sss.com/files/xxx/123.jpg .
Note this link is not real this is sample and image is of size 2071X3097
Suresh.M

Similar Messages

  • Out Of Memory Exception While Loading Images in Windows Phone 8 Silverlight App?

    Hi,
    I am developing a windows phone 8 silver light app , I am loading high resolution images from web  through image control , After loading 2-3 images I am getting outof memory exception ,
    I am unable to catch this , and I am unable to break this exception , Can anyone tell me how to handle this exception,
    I am searching solution for this  from last 15 days but I am unable to find solution,
    I tried by setting the bitmap image source to null by doing this also I am getting exception, I tried by using gc.collect() also ..
    First I am loading list of images in listbox with lowres of size 100X100 , in selection change event I am changing the image source , 
    My image control code is
    <Canvas Width="480" Height="720">
    <Image Width="480" x:Name="MyImage" Height="720" Stretch="Uniform" >
    <Image.Source>
    <BitmapImage x:Name="MyImage1"/>
    </Image.Source>
    <toolkit:GestureService.GestureListener>
    <toolkit:GestureListener Flick="GestureListener_Flick_1"
    PinchStarted="OnPinchStarted" DragDelta="GestureListener_DragDelta"
    PinchDelta="OnPinchDelta"/>
    </toolkit:GestureService.GestureListener>
    <Image.RenderTransform>
    <CompositeTransform x:Name="myTransform"
    ScaleX="1" ScaleY="1"
    TranslateX="0" TranslateY="0"/>
    </Image.RenderTransform>
    </Image>
    </Canvas>
    My listbox selection changed code is
    GC.Collect();
    GC.WaitForPendingFinalizers();
    Classes.PgaeInfo ob = listpages.SelectedItem as Classes.PgaeInfo;
    progressLoad.Visibility = Visibility.Visible;
    LayoutRoot.Opacity = 0.8;
    LayoutRoot.IsHitTestVisible = false;
    StackPanel st = sender as StackPanel;
    index = ob.pId - 1;
    JArray jsonArray = JArray.Parse(json);
    JToken jsonArray_Item = jsonArray[index];
    string sour = "xxx.xxx.xxx.jpeg" (only one image for sample)
    img.Source = null;
    DisposeImage(bm);
    img.Source = new BitmapImage(new Uri(sour));
    MyImage1.UriSource = null;
    MyImage1.DecodePixelHeight = (int)img.Height;
    MyImage1.DecodePixelWidth = (int)img.Width;
    MyImage1.UriSource = new Uri(sour);
    Any help..
    thanks..
    Suresh.M

    Hello Suresh,
    Are you loading multiple images at once on one page? If so this is an expected behavior. There is limited memory available per app so it's important to not load too large or too many photos at once in your app.
    If possible you can try to convert your Windows Phone 8 to Window Phone 8.1 so as to take advantage of the FlipView control which is built to handle photo gallery-like applications.
    Also you can always run the Windows Phone Application Analysis tool to check on the application performance and memory usage. This will help you test and fine tune your app accordingly.
    Let me know if this helps.
    Abdulwahab Suleiman

  • Getting an Out of memory exception while validating XML against XSD

    Hello friends,
    I am getting an Out Of Memory exception while validating my XML against a given XSd which is huge.
    SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
            saxParserFactory.setValidating(true);
              SAXParser saxParser = saxParserFactory.newSAXParser();
             saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
             saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource",new File("C:/todelxsd.xsd")); as u may see the darkened code. this basically Loads the XSD in Memmory , and JVM throws an out of Memory exception. is there any other way round of validating an XML against an XSD where i dont have to load my XSD if not then kindly let me know the solution for above problem .
    Thanks.

    Yes, but increasing the heap size is a temporary solution , isnt there a way where the XML can be validated against an XSD without having to load XSD in memory

  • Getting an out of memory exception while validating my XML against a XSD

    Hello friends,
    I have asked this question in following thread too. Pasting it again here just to saye your time
    http://forum.java.sun.com/thread.jspa?threadID=690812&tstart=0
    I am getting an Out Of Memory exception while validating my XML against a given XSd which is huge.
    SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
            saxParserFactory.setValidating(true);
              SAXParser saxParser = saxParserFactory.newSAXParser();
             saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
             saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource",new File("C:/todelxsd.xsd")); as u may see the darkened code. this basically Loads the XSD in Memmory , and JVM throws an out of Memory exception. is there any other way round of validating an XML against an XSD where i dont have to load my XSD if not then kindly let me know the solution for above problem .
    Thanks.

    Yes, but increasing the heap size is a temporary solution , isnt there a way where the XML can be validated against an XSD without having to load XSD in memory

  • Getting 'Out of memory' error while opening the file. I have tried several versions of Adobe 7.0,9.0,X1. It is creating issue to convert PDF into TIFF. Please provide the solution ASAP

    Hello All,
    I am getting 'Out of memory' error while opening the file. I have tried several versions of Adobe 7.0,9.0,X1.
    Also, it is creating issue to convert PDF into TIFF. Please provide the solution ASAP.

    I am using Adobe reader XI. When i open PDF it gives "OUT of memory" error after scrolling PDF gives another alert "Insufficient data for an image". after clicking both alerts it loads full data of PDF. It is not happening with all PDFs. couple of PDFs are facing this issue. Because of this error my software is not able to print these PDFS into TIFF. My OS in window7*64. I tried it on win2012R2 and XP. Same issue is generating there.
    It has become critical issue for my production.

  • Why i'm getting out of memory exception when trying to comparing two Lists ?

    First this is a paint event.
    In the paint event i draw a rectangle and then adding the pixels coordinates inside the rectangle area to a List:
    private void pictureBox1_Paint(object sender, PaintEventArgs e)
    if (cloudPoints != null)
    if (DrawIt)
    e.Graphics.DrawRectangle(pen, rect);
    pointsAffected = cloudPoints.Where(pt => rect.Contains(pt));
    CloudEnteringAlert.pointtocolorinrectangle = pointsAffected.ToList();//cloudPoints;
    Bitmap bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height, PixelFormat.Format32bppArgb);
    CloudEnteringAlert.Paint(e.Graphics, 1, 200, bmp);
    I'm drawing a rectangle thats the rect(Rectangle) variable and assigning to pointsAffected List only the pixels coordinates that are inside the rect area ! cloudPoints contain all the pixels coordinates all over the image !!! but pointsAffected contain only
    the coordinates of pixels inside the rectangle area.
    Then the mouse up event:
    private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
    StreamWriter w = new StreamWriter(@"c:\diff\diff.txt");
    pixelscoordinatesinrectangle = new List<Point>();
    pixelscoordinatesinrectangle = pointsAffected.ToList();
    DrawIt = false;
    for (int i = 0; i < trackBar1FileInfo.Length; i++)
    DrawIt = true;
    trackBar1.Value = i;
    LoadPictureAt(trackBar1.Value, sender);
    pictureBox1.Load(trackBar1FileInfo[i].FullName);
    ConvertedBmp = ConvertTo24(trackBar1FileInfo[trackBar1.Value].FullName);
    ConvertedBmp.Save(ConvertedBmpDir + "\\ConvertedBmp.bmp");
    mymem = ToStream(ConvertedBmp, ImageFormat.Bmp);
    backTexture = TextureLoader.FromStream(D3Ddev, mymem);
    scannedCloudsTexture = new Texture(D3Ddev, 512, 512, 1, Usage.Dynamic, Format.A8R8G8B8, Pool.Default);
    Button1Code();
    pictureBox1.Refresh();
    newpixelscoordinates = new List<Point>();
    newpixelscoordinates = pointsAffected.ToList();
    if (pixelscoordinatesinrectangle != null && newpixelscoordinates != null)
    IEnumerable<Point> differenceQuery =
    pixelscoordinatesinrectangle.Except(newpixelscoordinates);
    // Execute the query.
    foreach (Point s in differenceQuery)
    w.WriteLine("The following points are not the same" + s);
    else
    am1 = pixelscoordinatesinrectangle.Count;
    am2 = newpixelscoordinates.Count;
    //MessageBox.Show(pixelscoordinatesinrectangle.Count.ToString());
    w.Close();
    Once i draw the rectangle when finish drawing it i'm creating a new List instance and store the pixels in the rectangle area in the pixelscoordinatesinrectangle List.
    Then i loop over trackBar1FileInfo that contains for example 5000 images files names from the hard disk.
    This is the problem part:
    pictureBox1.Refresh();
    newpixelscoordinates = new List<Point>();
    newpixelscoordinates = pointsAffected.ToList();
    if (pixelscoordinatesinrectangle != null && newpixelscoordinates != null)
    IEnumerable<Point> differenceQuery =
    pixelscoordinatesinrectangle.Except(newpixelscoordinates);
    // Execute the query.
    foreach (Point s in differenceQuery)
    w.WriteLine("The following points are not the same" + s);
    else
    am1 = pixelscoordinatesinrectangle.Count;
    am2 = newpixelscoordinates.Count;
    I'm doing refresh for the pictureBox1 so it will go one each image to the paint event and will create a new List pointsAffected will have each time a different pixels coordinates.
    So newpixelscoordinates should be with new pixels coordinates each loop itertion.
    Then i'm comparing both Lists newpixelscoordinates and pixelscoordinatesinrectangle for a different items.
    And write those who are not the same to a text file.
    So i'm getting a very large text file with many pixels coordinates that are not the same in both Lists.
    The problems are:
    1. Does the comparison i'm doing is right ? I want to compare one list index against other listi ndex.
       For example in the List newpixelscoordinates in index 0 if i have x = 233 y = 23 and in the List pixelscoordinatesinrectangle in index 0 there is x = 1 y = 100 then write this as not the same to the text file.
      What i want to do is to check the whole List items against the other List items and if some of the items are not the same write this items to the text file.
    Next itertion new image new Lists with new pixels coordinates do the same comparison.
    The List pixelscoordinatesinrectangle is not changing it's storing the first pixels coordinates when i drawed the rectangle first time. Only the List newpixelscoordinates change each time, Should change each itertion.
    2. The exception i'm getting is on the line:
    newpixelscoordinates = new List<Point>();
    I added this line since i thought maybe i didn't clear it each time but it didn't help.
    Before adding this line the exception was on the line:
    newpixelscoordinates = pointsAffected.ToList();
    The exception is: OutOfMemoryException: Out of memory
    System.OutOfMemoryException was unhandled
    HResult=-2147024882
    Message=Out of memory.
    Source=System.Drawing
    StackTrace:
    at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
    at System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y, Int32 width, Int32 height)
    at System.Drawing.Graphics.DrawImage(Image image, Rectangle rect)
    at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe)
    at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
    at System.Windows.Forms.Control.WmPaint(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    InnerException:

    Hi Chocolade1972,
    >> Does the comparison i'm doing is right ? I want to compare one list index against other listi ndex.
    I think you could use “Object.Equals” and the link below might be useful to you:
    # Object.Equals Method (Object)
    https://msdn.microsoft.com/en-us/library/bsc2ak47(v=vs.110).aspx
    >> OutOfMemoryException: Out of memory
    This error is very common, and when there is not enough memory to continue the execution of a program, it would be thrown.
    It would be helpful if you could provide us a simple code to reproduce your issue.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • Hyperion IR : Getting out of memory error while fetching data for whole year through web client (wrokspace)

    Hi,
    While fetching data though IR wen client from workspace for a year(all 12 months) I am getting error as ("Out of Memory .Advice : Close other applications or windows and try again").
    If I am trying same through IR studio it does not give any output and show me same repoting front page.
    If i am selecting periods till 8 months it is giving the required data in both IR web client and IR studio.
    Could you please suggest how can we resolve this issue.
    Thanks,
    D.N.Rana

    Issue Cause :
    Sometimes this is due to excessive data which brings the size of the BQY file up around one gigabyte uncompressed in size (for processing may take twice as actual RAM, plus the memory space space for the plugin, and the typical memory limit on a 32-bit system is 2 gigabytes).
    Solution :
    To avoid excessive BQY size exceeding memory availability:
    Ensure that your computer has at least 2Gb of free RAM before he runs IR Studio.
    Put a limit to the number of rows that can be pulled down: Right click on Request label of Query section and put a value in Return First xxx Rows (and check the check box).
    Do not pull down more than 750 MB of data (remember it may be duplicated while processing).
    Place limits or aggregations in Query section (as opposed to Result section) to limit data entering the BQY.

  • Out of memory exception while reading the records in crystal report

    hi..
    im using sap crystal report version 13.0.2000.0.
    i've 27,000 records to be printed but when i run my application
    the exception error is displayed "Out Of Memory"..
    i've my appliation in VS2010 and OS is server 64bit
    and 4GB RAM..
    i dont know what to do ...

    Ok. So this is a brand new report created in CRVS2010(?).
    I'd like you to go to the database menu and select "Set Data Source Location". Expand the "Poperties" node and tell me what you see next to "Database Type"
    Also, I've also got a bit of a confusion on my part. In the inital post you say:
    i've 27,000 records to be printed but when i run my application
    the exception error is displayed "Out Of Memory"..
    But a bit later on you say:
    if there are 8000 records it'll take around 2 minutes
    to display the records..
    but there are 27000 records it will take more
    amount of time and the browser hangsup..
    So, is the issue when printing, or viewing?
    - Ludek

  • Out of Memory Exception while I am not using the all memory

    Dear,
    On the Java sun Emulator, I use the memory graphic to see how i could optimize my application.
    And I have got what that's for me a suprise, a Out of Memroy Excpetion while the graphic show that I use a bit less thant the half of the memroy available.
    Does someone could make guess about the troubles or giving me some clouds ?
    Chear,
    Ol

    Nicky,
    Pardon me if I am stating the obvious, but the Oracle 10g database embedded JVM is compatible with JDK 1.4 (and not JDK 1.5 -- even though NIO was introduced with JDK 1.4).
    Also, the Oracle JVM is not the same as SUN's, so don't expect it to behave in exactly the same way. For differences between them, I suggest looking through the Oracle documentation, and exploring the MetaLink Web site.
    Good Luck,
    Avi.

  • Getting Out of memory error while using HashMap

    Hi,
    I'm using HashMap to have string as key, some object as value.
    oHm.put(sKey, oMyVal); //oHM - HashMap
    The actual number of entries i need to put is 200K....
    Buy my program is not crossing even for 100K....
    Its giving OutOfMemory error...... ( 1 GB memory, Win XP )
    Any pointers to resolve this?
    Thanks in Advance...
    Ashok

    Do we have any alternate other than increasing the memory for JVM?Did you read what I said on 8/04/2008 22:20 (reply 1 of 5)?
    It's still the best looking option, especially if this large number is going to grow.

  • Download Servlet throwing Out Of Memory Exception

    I am trying to download file of more than 500 mb through servlet but getting out of memory exception .
    Before downloading i am zipping that huge file .
    try {
         String zipFileName = doZip(file);
          file =null;
          System.gc();
          File inputFile = new File(zipFileName);
          InputStream fileToDownload = new FileInputStream(
                                            inputFile);
           response.setContentType("application/zip");
         response.setHeader("Content-Disposition","attachment; filename=\""
                                                      + fileName.replaceAll("tmx", "zip")
                                                                .concat("\""));
         response.setContentLength(fileToDownload.available());
         byte buf[] = new byte[BUF_SIZE];
         int read;
         while ((read = fileToDownload.read(buf)) != -1) {
                   outs.write(buf, 0, read);
              fileToDownload.close();
                   outs.flush();
                                  outs.close();
    }catch(Exception e ) {
      //Getting out of memory.
    }Please suggest solution for this .

    cotton.m wrote:
    My zip suggestion was as follows.
    Take the file. Do not set the Content length header. Do set the Content encoding header to gzip. Create a GZIP output stream using the servlet output stream. Read the unzipped file in and output it through the gzip output stream.
    This cuts out one full cycle of file reading and writing from what you are doing currently.Thanks for u r reply
    InputStream fileToDownload = new FileInputStream(
                                            file);
    response.setContentType("application/gzip");
    response.setHeader("Transfer-Encoding", "chunked");
    response.setContentLength((int) file.length());
    GZIPOutputStream gzipoutputstream = new GZIPOutputStream(outs);
    byte buf[] = new byte[BUF_SIZE];
    int read;
    while ((read = fileToDownload.read(buf)) != -1) {
         gzipoutputstream.write(buf, 0, read);
    fileToDownload.close();
    outs.flush();
    outs.close();I made changes accordingly . Please provide u r view on this .

  • Oracle.jdbc.driver.T4CPreparedStatement causing out of memory exception

    I am using oracle spatial 11.2.0.3 g.
    I am getting out of memory exception on a process.
    I analyzed the heap dump using OOMemory analyzer and figured out  oracle.jdbc.driver.T4CPreparedStatement keeping 73%  of the heap space.
    Is oracle expanding the SPARQL queries in java side or keeping the results in cache.
    How to solve it ?

    Hi,
    We will need a re-producible test case (preferably small) to figure out why you are getting out of memory. You can send it to Oracle Support or email me at alan dot wu at oracle dot com.
    Jena Adapter does not cache SPARQL query results on the Java side. The T4CPreparedStatement is not even in Jena Adapter's
    code path or RDF's code path.
    Thanks,
    Zhe Wu

  • How to get the device token in windows phone 8 sliverlight application?

    Hi,
    I am developing a windows phone 8 silverlight application . For my application I want to add push notification service , for this service I have to call one web service in my app . This api requires device token , device id ..etc , I am able to get the all
    the things except devicetoken .
    How to get the device token of a device ?
    any help?
    Thanks...
    Suresh.M

    Most probably device token is the push channel url which is returned by MPNS when a request is made to it.
    Step 3 here: Push notifications for Windows Phone 8
    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8

  • Report with more than 600 kb image - BO Server getting Out Of memory Error

    Hi,
       We have a report which displays images and size is above 600 KB.We are getting an "Out Of memory" Error while previewing this report in Business Object Server.
    In another situation we tried by giving a dynamic path to the OLE object, but the report is not showing error. We are not able to view the image whose size is more than 600KB
    Notes: 1. Image is stored as a BLOB  in Oracle Database
               2. Connection used inside the report is OLEDB
               3. UNIX Environment
    Regards,
    Sathish

    Please re-post if this is still an issue to the Business Objects Forum or if you have a valid support contract create a case on line.

  • Motorola and out of memory exception

    Hi All!
    Often on Motorola devices i get a message with out of memory exception and application crashes.
    Is there a way to catch this kind of exception inside of a java machine?

    I know why I get exception - I load many images.
    But I indeed must have it preloaded.
    When free memory is low i can show alert but first I would like to try load an image anyway.
    And instead to go to catch exception clause an application is being crashed.

Maybe you are looking for

  • Need help on  development of check box

    Hi All, We need to place a "Select All" Checkbox at top of the another checkbox(CB_1) in the form.Where CB_1 is associated with the form fields) Our Requirement is, when we click on "Select All" checkbox it should select the CB_1 check box(all the re

  • Using or for the same attribute?

    /web:window[@index='0']/web:document[(@name='body' or @name='finderBody')]/web:form[@name='search']Is this valid? I can't seem to make it work. The app under test has different names in the two supported versions. Using the right name attribute works

  • Lock box error

    Hi Gurus , When i upload the lockbox file in FLB2 , I am getting the following error message . Accounts receivable posting Error: (F5 263) The difference is too large for clearing No customer with MICR number . can you please tell me what i need to d

  • Basic material regarding SD

    Hi Experts, I am an abap resource. I want to learn very basic concepts of SD. Can you please give me some basic material. Regards, krishan

  • Look for a tool to view BLOB value

    Hi all, Although I know that I can write a simple java program to view and insert values to BLOB field, I hope there could be a tool by which I can handle BLOB field easily and quickly. Can anybody recommend a tool or some SQL statement? Thank you in