Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Run out of memory when click a gameobject on the scene

Discussion in 'Editor & General Support' started by wwu39, Jan 10, 2024.

  1. wwu39

    wwu39

    Joined:
    Nov 21, 2018
    Posts:
    30
    I have an RTS-based game. There is a gameobject called "MAP" containing all 64x64 tiles information of the whole map. Tiles aren't gameobjects, just classes. The array of those tiles has [HideInInspector]. The game runs fine but when I pause the game and click on the MAP object in the scene to inspect it the whole unity editor freezes and after some time it crashes due to out of memory.
    I'm not sure why it has enough memory to run but not enough memory to inspect. Since the editor always crashes, I can't find a way to debug it either.
     
    Last edited: Jan 10, 2024
  2. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    2,011
    64x64 is "only" 4096. I highly doubt this is enough to freeze the editor or make your computer run out of memory.

    Most likely, there's an infinite loop somewhere in your code that only gets triggered via the editor. Time for some good old binary-search debugging: start stripping stuff out from your code until you find the culprit.