Search Unity

UWP win32 store apps cannot alloc 700MB in heap in a machine with 16GB !

Discussion in 'Windows' started by frankadimcosta, Mar 18, 2018.

  1. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    173
    Debuggin my game (Unity 2017.3.1.p4) with Visual studio comm 2017 i have this error for UWP X86 version



    DynamicHeapAllocator allocation probe 1 failed - Could not get memory for large allocation 338722384.
    DynamicHeapAllocator allocation probe 2 failed - Could not get memory for large allocation 338722384.
    DynamicHeapAllocator allocation probe 3 failed - Could not get memory for large allocation 338722384.
    DynamicHeapAllocator allocation probe 4 failed - Could not get memory for large allocation 338722384.
    DynamicHeapAllocator out of memory - Could not get memory for large allocation 338722384!
    Could not allocate memory: System out of memory!
    Trying to allocate: 338722384B with 16 alignment. MemoryLabel: DynamicArray
    Allocation happend at: Line:559 in C:\buildslave\unity\build\Runtime/Utilities/dynamic_array.h
    Memory overview

    [ ALLOC_DEFAULT ] used: 601683171B | peak: 0B | reserved: 706985835B
    [ ALLOC_TEMP_JOB ] used: 381B | peak: 0B | reserved: 1048576B
    [ ALLOC_TEMP_BACKGROUND_JOB ] used: 0B | peak: 0B | reserved: 1048576B
    [ ALLOC_GFX ] used: 46088B | peak: 0B | reserved: 5242880B
    [ ALLOC_CACHEOBJECTS ] used: 814556B | peak: 0B | reserved: 8388608B
    [ ALLOC_TYPETREE ] used: 0B | peak: 0B | reserved: 0B
    [ ALLOC_PROFILER ] used: 702560B | peak: 0B | reserved: 8388608B
    [ ALLOC_TEMP_THREAD ] used: 34344B | peak: 0B | reserved: 3670016B
    Could not allocate memory: System out of memory!
    Trying to allocate: 338722384B with 16 alignment. MemoryLabel: DynamicArray
    Allocation happend at: Line:559 in C:\buildslave\unity\build\Runtime/Utilities/dynamic_array.h
    Memory overview

    [ ALLOC_DEFAULT ] used: 601683171B | peak: 0B | reserved: 706985835B
    [ ALLOC_TEMP_JOB ] used: 381B | peak: 0B | reserved: 1048576B
    [ ALLOC_TEMP_BACKGROUND_JOB ] used: 0B | peak: 0B | reserved: 1048576B
    [ ALLOC_GFX ] used: 46088B | peak: 0B | reserved: 5242880B
    [ ALLOC_CACHEOBJECTS ] used: 814556B | peak: 0B | reserved: 8388608B
    [ ALLOC_TYPETREE ] used: 0B | peak: 0B | reserved: 0B
    [ ALLOC_PROFILER ] used: 702560B | peak: 0B | reserved: 8388608B
    [ ALLOC_TEMP_THREAD ] used: 34344B | peak: 0B | reserved: 3670016B


    (Filename: C:\buildslave\unity\build\Runtime/Allocator/MemoryManager.cpp Line: 1090)


    PS:
    The X64 version is OK
    I think this problem is affection ARM version too



    Can you help me ? TNX.
     
    Last edited: Mar 18, 2018
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,555
    Are you using .NET or IL2CPP scripting backend? What's the actually total committed memory during this crash?
     
  3. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    173
    IL2CPP.
    I solved removing the intro scene. The build is only 200mb. I don't know the " actually total committed memory during this crash"
    The UWP x64 works with no problems, including the intro scene.
    The UWP ARM crashes at start after spashscreen. Before showing Unity Logo
     
    Last edited: Mar 19, 2018
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,555
    When the debugger breaks, with a crash like that, open task manager, go to details tab, right click on the columns, click "select columns", enable "Commit size", and check the usage for your process.

    You can also try enabling /LARGEADDRESS aware linker, which will make your process see 4 GB of RAM instead of 2 GB on 64-bit machines, but keep in mind that on 32-bit machines the limit will be much less.

    upload_2018-3-19_9-2-56.png
     
  5. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    173
    TNX !
    The strange thing is that the WEBGL game version runs well (without the intro scene) Memory usage is less than 600MB.
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,555
    Of the whole process or just Unity's part? The hard limit is on the whole process, and there are other things using memory besides just your game (graphics driver, etc).