locked
WinJS web cache takes 1GB of RAM after 20 minutes using an app

    Question

  • Hi all,

    I'm not sure about what is going on but my app takes 1GB in the RAM (seen it in the Task Manager) after using it for 20 minutes.

    The app displays many pictures while we're browsing it (it's a news reader) and it seems that they're never deleted from the cache while the app runs. When I profile the app, VS tells me that the memory heap never goes up to 30MB so I assume it's a web cache problem...

    Is there anything we can do about that?

    Thanks,
    Pierre

    Monday, September 15, 2014 9:32 AM

All replies

  • It sounds like you have a memory leak, not a web cache issue. Web cache has nothing to do with amount of memory used as seen in the task manager.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, September 15, 2014 12:10 PM
    Moderator
  • Ok, thanks for your answer.

    Do you know how could I detect a memory leak that doesn't appear in the memory profiler tool of Visual Studio?

    Also, being 1GB of RAM occupied, it certainly has to be about pictures, do you know if there is a way to "retain" pictures data inside the app's heap instead of the web cache that we could accidentally have done?

    For example: I start a diagnostics session for "Javascript Memory" and take some heap snapshots after using the app for 2 minutes, the task manager tells me the app consumes about 100MB but when I look at the heap snapshot, it tells me that it's about 10MB...


    Monday, September 15, 2014 12:30 PM
  • Yes, there are ways to leak memory in your app. Have you tried explicitly setting the picture to null after using it?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, September 16, 2014 1:19 PM
    Moderator