Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Networking memory leak and strange behaviour?!

Discussion in '2018.3 Beta' started by AbgaryanFX, Nov 28, 2018.

  1. AbgaryanFX

    AbgaryanFX

    Joined:
    Jan 9, 2010
    Posts:
    167
    Memory leak
    upload_2018-11-28_11-33-13.png

    NetworkTransport.Receive does not want to work without calling "NetworkTransport.Init();" on each update.
    Code (CSharp):
    1.         NetworkTransport.Init();
    2.         NetworkEventType type = NetworkTransport.Receive(
    3.             out recHostId,
    4.             out connectionId,
    5.             out channelId,
    6.             recBuffer,
    7.             BYTE_SIZE,
    8.             out dataSize,
    9.             out error
    10.         );
     
    Last edited: Nov 29, 2018
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Could you please submit bug reports for these issues?
     
  3. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    Hmm, I do not understand what does it mean "Receive doesn't work". Could you please open the bug, attach repro project, describe repro steps and describe expected result. Without this It is very difficult to help you. During continuous integration network library run different tests set, and for sure, these tests includes test Receive() function too, so due persist critical error Network just couldn't pass test phase...
     
  4. AbgaryanFX

    AbgaryanFX

    Joined:
    Jan 9, 2010
    Posts:
    167
    Done: Case 1105034
     
    LeonhardP likes this.
  5. AbgaryanFX

    AbgaryanFX

    Joined:
    Jan 9, 2010
    Posts:
    167
    Update!

    There was a NetworkManager on disabled gameObject, I removed it, restarted unity and message was gone.
    So, you may dig in that direction, guys.
     
  6. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    Artyom the problem with your code - these code has been never called, so library has not initialised.
    Code (CSharp):
    1.     private void Awake()
    2.     {
    3.         // DontDestroyOnLoad(gameObject);
    4.         Init();
    5.     }
    I added script to here which is almost yours with some small changes: transport has been initialised inside Start().
    + I added connection to itself and sending data to itself.
    Check please,
    Create new scene
    Add GameObject, attach NewNetworkManager to this object
    Run
    --->Profit should be here <----

    Regards
    Alex
     

    Attached Files:

    LeonhardP likes this.