Search Unity

Headless build causes memory leak

Discussion in 'Multiplayer' started by alextoti33, Aug 20, 2019.

  1. alextoti33

    alextoti33

    Joined:
    Oct 8, 2017
    Posts:
    66
    Hello everyone!
    I'm making a multiplayer game using Unity as client and Socket.io (Nodejs as server). So for the AI im creating a new client, rather than running the ai in the server (Its an arena game, so there wont be needed many clients for AI), this way its like the AI is running on its same computer, anyway so when im running on normal build it's working perfectly, though if i run on headless build im getting this error: https://imgur.com/a/RaJ6XUT
    Then the client that im running through the editor is getting disconnected and reconnected automatically.
     
  2. ep1s0de

    ep1s0de

    Joined:
    Dec 24, 2015
    Posts:
    168
    Apparently in the code somewhere you are trying to cast one type to another but a memory leak occurs ...


    For example: I have a variable float which is 1337.1337 and I want to translate it into long in this way:

    float value1 = 1337.1337f;
    long value2 = (float) value1;

    As a result, long takes 8 bytes in memory and float takes 4 bytes and we have 4 extra bytes in memory that are not used anywhere




    Knowledgeable people will correct me if I wrote something wrong :)
     
  3. alextoti33

    alextoti33

    Joined:
    Oct 8, 2017
    Posts:
    66
    I see, thanks