Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Memory issues

Discussion in 'Scripting' started by tawdry, Dec 15, 2014.

  1. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,356
    Hi folks
    As the title says having memory issues is there a script somewhere that can help me find the problem or problems. Not using Pro.
    Thx
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,516
    If one of your scripts is leaking memory, try running the game and turning off various scripts and seeing if the leaking goes away. Try and isolate which functionality in your game is leaking by turning off large chunks of the game and eliminating what might not be causing the problem.

    One that gets me occasionally is doing a GameObject.Instantiate() inside my Update() (or other frequently-called) function, often from code that was supposed to go into a run-once Start()-like function.

    Things that don't actually appear in your scene (such as GUISkins) are another source of leakage.
     
  3. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,356
    Problem is i don't have any scripts running yet lol or even animation just creating the scene. my fps is 60-70 so either a gameobject or textures are the culprit.
     
  4. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    If you don't have any scripts running, it's highly unlikely that you are running into memory leaks. Are you expecting more than 60-70 FPS? I believe its capped at that in the editor.
     
  5. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,356
    Don't think its a leak i think something or somethings in the scene is reserving too much memory just want to find out what it is and use something else unity is crashing because it cannot allocate more memory. Fun fact i have got 1000 fps with a scene that had 600x600 full grassed terrain lmao major misreporting on unity's part there. .
     
  6. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,356
    I have a lot of stuff 3d objects textures etc in my project that arnt used in the scene does this effect memory at all? or just what is placed in the scene?