Search Unity

CRASH! Out of Memory

Discussion in 'Editor & General Support' started by eastwood, Aug 12, 2012.

  1. eastwood

    eastwood

    Joined:
    Aug 12, 2012
    Posts:
    3
    Recently, I often get an "Out of Memory" crash in our web game. But some weeks ago, it not happens such frequently.

    Log Contents:
    It happens when downloading assetsbundles.But not always at the same file or the the same place.
    I just doubt that if it is related with the size of assetsbundle or the size of one file in assetbundle?
    Actually, no assetsbundle or file in the project bigger than 8388608B.

    It's really a big problem for me. Please give me some clues...
     
  2. eastwood

    eastwood

    Joined:
    Aug 12, 2012
    Posts:
    3
    Is there anybody knows why?

    BTW, I found it happens in some browser based on IE core regularly, but in Chrome much more less.
     
    Last edited: Aug 13, 2012
  3. Sir-Tiddlesworth

    Sir-Tiddlesworth

    Joined:
    Oct 19, 2011
    Posts:
    908
    Is it only happening to you, or are other people having the same issue.
    Normally you would an out of memory error when either:

    1. Your computer has run out of ram.
    2. The program (in this case the web browser) hasn't had enough memory allocated to run.
     
  4. eastwood

    eastwood

    Joined:
    Aug 12, 2012
    Posts:
    3
    Yes,I found some questiones in UnityAnswer are very similar to it. But no reply.

    I don't think it's because of running out of ram or hasn't had enough memory allocated to run.
    Have you noticed that the Largest Alloc for the memory using for File is 8388608.
    I think 8388608B is the upper size of a file which exists in memory.

    But the strange thing is that no assetsbundle or file in my game is bigger than 8388608B.
     
  5. rab

    rab

    Joined:
    Nov 13, 2009
    Posts:
    101
    Hi there, I have the same problem on my iPad-App. Sometimes the app will crash when loading many assetbundles (aprox. 1000) in a loop. All files are smaller than 2 Megabyte so I don't know why over 8 million bytes are requested. The crash is hard to reproduce.

    Here the message from the debug log:
    I have no idea how to fix this.

    Some info about softwareversions: Unity3D 3.5.5f3 - iOS Pro licence / iOS 5.1.1 (9B206)

    Kind regards!
     
  6. rab

    rab

    Joined:
    Nov 13, 2009
    Posts:
    101
    I found a solution to the problem at least at some costs.
    First I loaded files in a loop starting one coroutine per file, which was quick but got problems when loading many files at once (too much coroutines at once seems to be bad on iOS). Now I changed the loading to one coroutine which loads one file after the other. Takes alot more time but will not crash.

    Best regards!


    Chek out: Unity3D LightSettingManager AddOn
     
    Last edited: Oct 11, 2012