Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Windows Store 8.1 and memory issues

Discussion in 'Windows' started by scbundy, Jun 17, 2015.

  1. scbundy

    scbundy

    Joined:
    May 23, 2014
    Posts:
    51
    I'm having issues with Unity 5.0.2f and the Windows Store platform. My game runs fine on low end Android and even an iPhone 4 (albeit, it's slow). But when I compile for Windows Store Universal I get memory issues running it on a Nokia 920, which is much faster than an iPhone 4 and has far more memory.

    At first, some of my textures just don't draw. And I see this error in visual studio:
    d3d11: failed to create staging 2d texture

    The problem gets worse as I change scenes until finally it just crashes completely.

    Oddly enough, if I switch platforms to Windows Phone 8.0, the game performs great and has no memory issues.
     
    MrEsquire likes this.
  2. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Intresting, could be some issue with performance I also having.
    I think you need to try and debug this bit more, any chance you could to try and see what could be making slow and crash.
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    Could we get a bug report on this? We haven't observed increased memory usage on Windows Store target as opposed to Windows Phone 8.0 target so far, apart from 1-3 MB that the multithreaded renderer needs. It must be something that's specific to your project.
     
  4. scbundy

    scbundy

    Joined:
    May 23, 2014
    Posts:
    51
    I can submit a bug report. But I'm not sure how to even debug this. The game works great on every other platform including windows phone 8.0 and on devices with far less capability that the windows phone I have. It also works fine when I run it as a windows store app on my PC. But of course it has tons of memory available.

    When I was testing it in visual studio there were no other errors other than the one I posted above.

    The problem only occurs when its run as a windows store app on a windows phone. So in sorry, but, it really doesn't seem like its my project that has the problem.
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    If you submit a bug, we can take a look at it. Don't forget to post the case number here.

    As for debugging it yourself: we can work on that in this thread. First of all, have you actually confirmed that it's a memory issue? Did you check what's the memory usage on WP8.0 app vs WP8.1 app or are you just guessing? When it crashes, do you have a callstack or the player log?
     
  6. scbundy

    scbundy

    Joined:
    May 23, 2014
    Posts:
    51
    Before the error I posted above there is a debug message about removing unused textures to reduce memory. I didn't have a chance to see how much memory it was using but it was a best guess looking at what was occurring. The game would stop dropping textures more and more frequently until the whole thing crashed. Memory issue seems the most likely. Especially given that the game works fine on other platforms, I can already rule out any errors made in my scripts. I have 2000 downloads so far on my other platforms and not a single crash has been reported.

    I can get the call stack when I'm off work and back at home.
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    Unity doesn't really unload unused textures because it's low on memory, it unloads them just because they aren't used. But yea, I can't really tell what's going on without more information.
     
  8. scbundy

    scbundy

    Joined:
    May 23, 2014
    Posts:
    51
    Yeah that message didn't concern me. Just seemed like standard garbage collection.

    I'll submit the bug tonight and get it to crash while I'm plugged into visual studio and see if there's any call stack.

    If there isn't I'm kinda stuck though. I can't fix anything if there's nothing for me to fix.
     
  9. scbundy

    scbundy

    Joined:
    May 23, 2014
    Posts:
    51
    Bug report submitted. Hope you guys can figure this one out cause it has me stumped. Case number is 705456.

    Thanks.