Search Unity

Memory leak

Discussion in 'Unity Ads & User Acquisition' started by ManulGames, Nov 15, 2018.

  1. ManulGames

    ManulGames

    Joined:
    Nov 18, 2015
    Posts:
    1
    Unity 2018.3.0b8
    Unity Monetization v3.0.0

    Test mode is on in Services tab and Dashboard

    Code (CSharp):
    1.  
    2.     private void Start() {
    3.         Advertisement.Initialize(_gameId);
    4.         StartCoroutine (ShowBannerWhenReady());
    5.     }
    6.  
    7.     IEnumerator ShowBannerWhenReady () {
    8.         while (!Advertisement.IsReady ("banner")) {
    9.             yield return new WaitForSeconds(0.5f);
    10.         }
    11.         Advertisement.Banner.Show("banner");
    12.     }
    13.    
    When start game in editor appear memory leak



    In a short time, many unnamed 2D textures are created in memory.
    And continue
     
  2. MayhemMike

    MayhemMike

    Joined:
    Oct 23, 2013
    Posts:
    51
    Same problem here, tried it with testmode en-/disabled but no difference
     
  3. braedenk

    braedenk

    Joined:
    Nov 8, 2016
    Posts:
    7
    Same issue. The ad banner in Editor play mode seems to consume about 15 MB of RAM per second until the editor or the whole machine crashes. Left the editor in play mode for < 15 min in the background and my computer crashed. Extremely frustrating. I'm using 2018.3 and Monetization 3.0.

    For what it's worth, I'm not seeing the same behavior in an Android build. The app appears to run fine. Hopefully iOS builds are similarly fine.
     
  4. braedenk

    braedenk

    Joined:
    Nov 8, 2016
    Posts:
    7
    Has anyone filed a bug report regarding this behavior? It's a pretty severe bug with one of the central features added to Monetization 3.0. I'm pretty sure making a minimal repro project would be trivial in this case.
     
    DenisasK and Peter77 like this.
  5. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    Indeed, if anyone knows how to reproduce this issue, please submit a bug-report, with an example/project to reproduce it, as described in the following document:
    https://unity3d.com/unity/qa/bug-reporting

    If there exists no bug-report for this issue in Unity Technologies database, chances are, that it does not get fixed. It's fine if the same issue is being reported more than once, it actually indicates more user pain and is likely to get looked at even sooner.

    After you submitted the bug-report, you receive a confirmation email with a bug-report Case number. You can post this Case number here (in this forum thread) for Unity staff to pick up, in case they see it.
     
    DenisasK likes this.
  6. braedenk

    braedenk

    Joined:
    Nov 8, 2016
    Posts:
    7
    Repro project created and bug report submitted. Case number is 1115398. Report status can be tracked here.
     
    Peter77 likes this.
  7. braedenk

    braedenk

    Joined:
    Nov 8, 2016
    Posts:
    7
    Just as a note to anyone else who has encountered this bug and is concerned about it, it does not seem to affect either Android builds or iOS builds; it only affects the editor, and you can always avoid it in editor with compiler directives.

    Still hope the bug gets addressed soon, considering that it causes computer crashes for any developers thinking they should try out the new banner ads feature in their apps... not exactly making a great first impression!
     
  8. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @ManulGames, @braedenk

    Thanks for reporting this issue and opening the bug report. The team is taking a look and should hopefully be able to resolve this issue soon.
     
  9. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    238
    Ive just been experiencing this using invokerepating to call for video ads. As soon as the ad loads, memory usage climbs until machine crashes.

    Havent tested it on device yet
     
  10. braedenk

    braedenk

    Joined:
    Nov 8, 2016
    Posts:
    7
    @Zaine7673
    This thread is specifically regarding a memory leak when using the Banner ad in the editor. What you describe sounds like a separate issue, so you may want to start a new thread (and bug report) for that.
    You might also want to check the memory profiler to see if you're specifically seeing a bunch of unnamed Texture objects getting generated and seeing the output in general look like the screenshot earlier in the thread. If not, it's probably a different issue.
    I suggest you post some snippets of the problematic code in a new thread describing the issue. I'd be happy to take a look and help you figure out where your problem might be.
    I would also suggest you try taking just the advertisement code and putting it into a minimal new project to see if you can reproduce the problem. If so, send in a bug report. https://unity3d.com/unity/qa/bug-reporting