Search Unity

"Allocation of 32 bytes at 0000027D70016A00" error on Unity Editor

Discussion in 'Scripting' started by Bagazi, Feb 20, 2020.

Thread Status:
Not open for further replies.
  1. Leslie-Young

    Leslie-Young

    Joined:
    Dec 24, 2008
    Posts:
    1,148
    > so yeah... I just can't with this thread anymore after going on 2 years.

    As Melv mentioned, it is a generic message and you will see a lot of reports with the "Allocation of 32 bytes at.." and accompanying warning and error on the Issue Tracker. I do not think all the posts here, especially the ones going back to 2020, are related to the described Terrain problem but those were probably reported via the bug tracker a long time ago anyway.
     
    FaffyWaffles likes this.
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    I'm sorry if I came across as frustrated but I think it's a stretch to say toxic. I spend a lot of my personal time and energy helping devs, I really do. Not because of any other reason than I care about helping. I work for Unity but I've been on leave since the beginning of December. I'm not paid for being here, it's because I care about being here. Heck, I work on 2D physics, this has nothing to do with my day job. That said, again, sorry if I got frustrated but you cannot say you've never been frustrated.

    It seems like something is moving forward though but as stated in the last few posts, I doubt this is the end of this story for this annoying console message. One day!
     
    bearcoree likes this.
  3. costin88boss

    costin88boss

    Joined:
    Apr 12, 2020
    Posts:
    6
    I'd want to say that it happens for me too, and i only see the random loggings when i get afk for a little long time. restarting my project fixes it (temporarily) which is good.
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    Unfortunately, as stated several times above, saying it happens to you on a forum post won't help anyone nor you in resolving it. What is required are bug reports.
     
  5. Leslie-Young

    Leslie-Young

    Joined:
    Dec 24, 2008
    Posts:
    1,148
    See if you can make it happen always under certain conditions. Then create a smaller/cleaner "test project" in which it happens and submit a bug report via menu: Help > Report a Bug. Describe in there how the person viewing the project can make the error happen if there are certain steps to be followed.

    Check previous page of this thread on how we found the problem with the terrain and determined how it can be reproduced.

    Good luck finding the problem. This "Allocation of 32 bytes" can be a tough one to track down cause of the little information and seemly random times it can happen.
     
  6. paraxis

    paraxis

    Joined:
    Jul 8, 2013
    Posts:
    1
    Hello together!

    Despite everything negativ said so far in regard of the "me too" posts - They were in fact very helpfull for me.
    I was observing a very similar issue (console filling with 999+ memory allocation messages) and i did not manage to reproduce it right.
    With the help of this thread i could nail it to the 5th terrain layer aswell. I did send a bug report and it turns out this issue is already tracked internaly.

    I can confirm it for Unity 2021.2.7f1 and 2021.2.6f1

    Steps to reproduce :

    Create a new 3D project
    Add a terrain object
    Create 5 texture layers (you can use default textures to reproduce)

    Solution : None afaik - I did switch to 2020 LTS (which works fine)

    Maybe this is/was also the cause for at least some of the reports on this thread...
     
    Trae_1P and MarcusJT like this.
  7. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    Agreed and it's great you found something to help you here but as you indicate, it'll not sort everyone out which is what the context of "me too" was talking about; not assuming it's the same root cause and just reporting bugs like you did. Thanks!
     
  8. HuldaGnodima

    HuldaGnodima

    Joined:
    Oct 10, 2016
    Posts:
    110
    I also get memory-leak-errors. Mine always happen when I publish changes while using the "collaboration tool". I submitted a bug-report here (in case it could be of help): https://fogbugz.unity3d.com/default.asp?1391760_3ua9i5e9jnils5gj

    I'm posting about my specific memory leak error here in case someone finds this thread in the future and has the same issue as me. This thread is the first I found via google about similar memory leek issues, so in case you just found this thread you can take a look at the bug-report and maybe there's some helpful feedback/comments about ways to solve the issue in it in the future :)!

    Thanks to everyone posting in the thread!
     
    eddiemost, MelvMay and bearcoree like this.
  9. Deleted User

    Deleted User

    Guest

    I would just like to say that your proclivity to go above and beyond the job role is greatly appreciated by myself, and I'm sure by many others too.
     
    MelvMay likes this.
  10. I wouldn't put fogbugz link out in the public. With that all of your bug reports becomes public both the one you did in the past and any future ones. Even if you didn't share anything confidential with the support in the past you will forget this and at some point you may do.
     
  11. MrJohnWeez

    MrJohnWeez

    Joined:
    Aug 31, 2013
    Posts:
    11
    Thank you this was also the cause for me when using the DiggerPro asset example scene from the asset store
     
  12. RobG88

    RobG88

    Joined:
    May 28, 2015
    Posts:
    28
    Can use Unity 2019, 2020, 2021 and now 2022, use it all day long, as soon as I make a commit with Collaborate these errors pop:

    TLS Allocator ALLOC_TEMP_TLS, underlying allocator ALLOC_TEMP_MAIN has unfreed allocations, size 41
    Internal: Stack allocator ALLOC_TEMP_MAIN has unfreed allocations, size 41
    To Debug, run app with -diag-temp-memory-leak-validation cmd line argument. This will output the callstacks of the leaked allocations.
    Allocation of 41 bytes at 000001FCC07007D0

    There are two ways to stop them - quit Unity and don't commit or Assets => Reimport All, which is basically quitting Unity, BUT as soon as there's a commit via Collaborate, all the errors are back.

    Click clear, errors come back.
    Click Play, ERRORS are +9999 in seconds.
    Click clear, and all is good, click anywhere and the errors pop again.

    The fix in Unity 2020 and 2021 use to be CLOSE the COLLABORATE tab, but that is no longer a fix.
     
  13. Serge_Billault

    Serge_Billault

    Joined:
    Aug 26, 2014
    Posts:
    190
    If TLS in this case stands for Thread Local Storage, it means that whoever is in charge of managing it or its content is not comfortable with threads and/or memory allocations, which, sadly, is not unheard of, coming from Unity or its third parties. But whatever the source of the problem may be, allowing this error to linger into Unity builds for so long is rather unprofessional, particularly when you know that memory leaks fixs are easy (excepted maybe for the inexperienced).
     
  14. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    It's called software bugs; it doesn't mean the dev who created a bug isn't qualified or experienced in that area. Software is complex, humans are fragile, unit/integration tests are not perfect.

    Also, this is exactly what I mean; the assumption that this is one fix (left for too long) because they errors look similar. It's likely several separate areas causing a similar issue. I could easily cause this in 2D physics (my area) but it wouldn't be the same fix. At the first hint of it, I'd be all over it asking for bug reports. A big problem is getting bug reports that can both duplicate issues and are easily able to identify the source of the issue; not devs being unprofessional. No team in Unity wants memory errors like this being produced.

    As frustrating as these kinds of bugs are I don't think you are adding anything useful to this thread by throwing comments like that about devs so let's leave your theory there please.
     
    Gravesend and lordofduct like this.
  15. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    This is bug report material right here also highlighting that this isn't a single issue. Hopefully you've made a bug report about this so someone in QA can verify it and pass it to the Collab team.
     
  16. Serge_Billault

    Serge_Billault

    Joined:
    Aug 26, 2014
    Posts:
    190
    In regard to your anwser I think it was on the contrary very usefull to the community because they can now associate a particular state of mind to this lingering problem.
     
  17. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    Well if countering your negative comments about developers being unprofessional and requiring bug reports is a state-of-mind then yes, guilty.

    I think it's about time to leave this thread. All that can be said has been.
     
  18. gewl

    gewl

    Joined:
    May 19, 2016
    Posts:
    95
    I'm getting this error in multiple projects as well, which makes Unity unusable for those projects. It may be related to this issue, although I'm not sure if the 'drag gameobject' component is really the root of the problem:
    https://issuetracker.unity3d.com/is...n-when-dragging-gameobject-from-editor-window

    From the last ~month of comments on this issue, it sounds as if this is an ongoing problem. Would love to hear if anyone has found a solution for this.
     
  19. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,290
    I'm now 100% sure that it has something to do with Terrains.

    I worked for several weeks without this error showing up even once, working on scripts, textures, models, everything really except terrain. Then I started working on terrain again and it didn't take long for it to show up again and repeatedly.
     
    MarcusJT likes this.
  20. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    Well I have this error but do nothing with terrain.
     
    ethanicus and HuldaGnodima like this.
  21. tetryds

    tetryds

    Joined:
    May 28, 2016
    Posts:
    3
    Me too :p

    I have the exact same issue, when dealing with terrains under URP on Unity 2021.2.8f1 using the "3D URP" template. My project has an island from the free island collection that uses the terrain system, and seems to be the culprit.
    I get the exact same logs, with endless "Allocation of 52 bytes at {location}", and then eventual errors. This happens several times in a row and a "Application.UpdateScene" window with a loading bar. After waiting for this to happen many times I can eventually use the editor again, but it gets less stable the longer I use the editor.
    It does not matter if I'm activelly using the editor or have it on the background, the issue starts happening eventually like a time bomb.
    Closing Unity and opening it again makes it stop, but only for so long until it starts happening again. For big projects it is really a pain.

    I am also using the simple water shader urp and an open source toon shader, this is the entire manifest.json:

    Code (JSON):
    1. {
    2.   "dependencies": {
    3.     "com.deltation.toon-shader": "https://github.com/Delt06/urp-toon-shader.git?path=Packages/com.deltation.toon-shader",
    4.     "com.unity.collab-proxy": "1.15.7",
    5.     "com.unity.ide.rider": "3.0.9",
    6.     "com.unity.ide.visualstudio": "2.0.12",
    7.     "com.unity.ide.vscode": "1.2.4",
    8.     "com.unity.render-pipelines.universal": "12.1.3",
    9.     "com.unity.test-framework": "1.1.30",
    10.     "com.unity.textmeshpro": "3.0.6",
    11.     "com.unity.timeline": "1.6.3",
    12.     "com.unity.ugui": "1.0.0",
    13.     "com.unity.visualscripting": "1.7.6",
    14.     "com.unity.modules.ai": "1.0.0",
    15.     "com.unity.modules.androidjni": "1.0.0",
    16.     "com.unity.modules.animation": "1.0.0",
    17.     "com.unity.modules.assetbundle": "1.0.0",
    18.     "com.unity.modules.audio": "1.0.0",
    19.     "com.unity.modules.cloth": "1.0.0",
    20.     "com.unity.modules.director": "1.0.0",
    21.     "com.unity.modules.imageconversion": "1.0.0",
    22.     "com.unity.modules.imgui": "1.0.0",
    23.     "com.unity.modules.jsonserialize": "1.0.0",
    24.     "com.unity.modules.particlesystem": "1.0.0",
    25.     "com.unity.modules.physics": "1.0.0",
    26.     "com.unity.modules.physics2d": "1.0.0",
    27.     "com.unity.modules.screencapture": "1.0.0",
    28.     "com.unity.modules.terrain": "1.0.0",
    29.     "com.unity.modules.terrainphysics": "1.0.0",
    30.     "com.unity.modules.tilemap": "1.0.0",
    31.     "com.unity.modules.ui": "1.0.0",
    32.     "com.unity.modules.uielements": "1.0.0",
    33.     "com.unity.modules.umbra": "1.0.0",
    34.     "com.unity.modules.unityanalytics": "1.0.0",
    35.     "com.unity.modules.unitywebrequest": "1.0.0",
    36.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    37.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    38.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    39.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    40.     "com.unity.modules.vehicles": "1.0.0",
    41.     "com.unity.modules.video": "1.0.0",
    42.     "com.unity.modules.vr": "1.0.0",
    43.     "com.unity.modules.wind": "1.0.0",
    44.     "com.unity.modules.xr": "1.0.0"
    45.   }
    46. }
    47.  
    The terrain was set to static, but I will attempt to see if setting it as dynamic or disabling contribute global illumination solves it.
    If anything solves the issue I will also post updates here.

    Update:
    The error only seems to start happening after playing the simulation for the first time.

    Update2:
    Just confirmed, it is the terrain. The moment I add it the entire editor starts hanging with a lot of allocations. It is clearly a leak, because removing the terrain does not stop the allocations, which makes it continue lagging. I have to remove the terrain, then save the scene, close Unity and open it again. The editor gets smooth again after that.
    I never really had a good experience with the unity terrain tool, does anyone know of another tool that can read terrain data that is more stable?
     
    Last edited: Jan 17, 2022
    Gravesend and WildStyle69 like this.
  22. HuldaGnodima

    HuldaGnodima

    Joined:
    Oct 10, 2016
    Posts:
    110
    I just want to update everyone if you had my problem (Allocation-error when using Unity's collaboration-tool), I found a fix!
    I'm on Unity version 2020.3.26f (LTS). Today I updated both the Visual Studio Editor and the Version Control to their newest versions (they just became public). They are now the following:

    Visual Studio Editor
    Version 2.0.14 - January 20, 2022
    Version Control
    Version 1.15.9 - January 18, 2022

    And my memory allocation problem/error is gone! :) So seems it was a bug (?) and they fixed it in the latest Version-control patch! AWESOME. If anyone here has a similar problem, updating all packages in your project might assist you (as it assisted me)? Hoping this helps someone!
     
    BryceS, MarcusJT and WildStyle69 like this.
  23. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    This exactly describes the bug as I'm getting it as well. There is no solution / workaround that I've yet found unfortunately.

    // Wildstyle
     
  24. Leslie-Young

    Leslie-Young

    Joined:
    Dec 24, 2008
    Posts:
    1,148
    @tetryds @WildStyle69 If you have more than 4 texture layers on the terrain then it is probably related to that. Unity is aware of that issue and working on it. Remove the extra layers for now and see if it helps.
     
    gotiobg likes this.
  25. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    Thanks for reply @Leslie-Young -- I've tracked my problem back today. It happens when I have a Better Lit Shader material on a model in the scene. After running the scene once the symptoms start, and are exactly the same.

    // Wildstyle
     
  26. Eggtooth

    Eggtooth

    Joined:
    Dec 29, 2015
    Posts:
    3
    Actually, I believe it may not be terrain.

    You see, I sat down today and tried to actually reproduce this problem. My scene has large ground object. It is not terrain however, but it is very large.

    When I enter play mode once and have "Selection Outline" selected under gizmos, then exit play mode and click the ground object (that mind you, is pretty large), I instantly get this error but with allocation of 56 bytes.

    When I however restart Unity, disable "Selection Outline" under gizmos, and then enter play mode, only to exit and select the ground, the error is not happening anymore.

    Before I file report, I will test this further but disabling Selection Outline may be the solution.

    The more I test, the more I am convinced that Selection Outline, depending on size of the object, actually casues memory leak.
     
    Last edited: Feb 21, 2022
    Gravesend and Tymianek like this.
  27. HenriCasper

    HenriCasper

    Joined:
    Nov 28, 2020
    Posts:
    1
    Would like to add to the ongoing discussion and say this has happened to me because of terrain.

    I had 5 terrain layers on it, and I decided to delete the terrain and create a new one. On the new one I added the layers again and it isn't happening anymore. Will update if it happens again.
     
    Last edited: Mar 9, 2022
    Gaspedal likes this.
  28. MDEP

    MDEP

    Joined:
    Apr 8, 2020
    Posts:
    1
    The vast majority of my bugs are solved by trawling through forum archives rather than official bug reports. This thread is quite aggravating because it's become a massive dialogue of people arguing with each other about posting bug reports or saying me too or stop posting me too.

    How about we just keep every post pertaining to the actual problem because solutions don't only come out of the official bug report channels so trying to shut down a thread like this because you're tired of people saying "Same problem here" is not constructive.

    I'm sure I'm not the only dev out there who has stumbled on what appears to be a nothing post, but ultimately it has led to the solution. I like seeing what other conditions people have had the issue under - even if Unity Staff don't. If you don't want people coming onto threads like this saying "same here, here's what I tried" then shut down your forums.
     
  29. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    Shutdown the forums? Trying to shutdown a thread? Not wanting devs to say "same here, here's what I tried". You're skewing what's been said, the above is being argumentative.

    Nobody has stopped anyone from doing anything. This thread is open, people can and are posting. The comments were clearly about trying to highlight to devs that they should report bugs where possible and not assume it has been reported or that it's a single bug because the symptom/error is similar. It's as simple as that, no need to inflate it.

    So go ahead, post your bug report, don't post your bug report, post "me too" or just read this thread as it's open, nothing is being suppressed, nothing needs to change here.

    There's certainly a far more constructive way to spend your first post. ;)
     
    pKallv likes this.
  30. Gravesend

    Gravesend

    Joined:
    Mar 4, 2013
    Posts:
    4
    This seems to be it, the problem disappeared when I followed your tip of turning off Selection Outline under gizmos! (Using 2021.2.7f1)

    I've noticed gizmos are a performance hog when drawing many of them (via script), which might not be related, but at least seems to make it more likely that you're on to something.

    I have been testing terrains in different projects, where I've had meshes over 2000 units in size. I had used smaller meshes (200x200 units) tiled to over 2000 units together, but not seen this problem (maybe I never group-selected them).
     
  31. PanTarZan

    PanTarZan

    Joined:
    Jul 13, 2017
    Posts:
    1
    im struggling the same with terrains under URP.
    im using "FREE Stylized PBR Textures Pack" as my source of terrain textures
    (https://assetstore.unity.com/packages/2d/textures-materials/free-stylized-pbr-textures-pack-111778)

    i've used render pipeline converter to upgrade materials and then painted my terrain.
    i've added normal maps to created layers and then after shader recompile memory leak occurs
    i even removed normal maps and issue still appears after while (little paint of terrain, save scene and play it.)
    i have 6 layers assigned to terrain

    My best guess would be something with URP -> Terrain -> calculating some shaders (URP/Terrain/Lit) -> using more than 1 layer on terrain (did not noticed anything with 1 layer even on texture with normal map)

    you guys having any links to most related issues? i may try to get some data to post there aswell (working in validation is a pain :D )

    Edit:
    unity 2021.2.8f1 Personal DX11 btw

    Edit2:
    999+ logs of: Allocation of 56 bytes at 000001A36078AFC0 (Addreses varies bus got 20+ stacked on same address)
    1 Error of: TLS Allocator ALLOC_TEMP_TLS, underlying allocator ALLOC_TEMP_MAIN has unfreed allocations, size 434112
    1 warning of: Internal: Stack allocator ALLOC_TEMP_MAIN has unfreed allocations, size 434112 (size is growing as hoverig cursor over terrain grows)

    how does one makes this StackAllocator.h shenanigans work to output full callstack :D
     
    Last edited: May 10, 2022
  32. deirre

    deirre

    Joined:
    May 5, 2013
    Posts:
    3
    I de-selected "Selection Outline" and my error went away. After months of submitting and requesting assistance from unity support....this solved my issue in minutes.
     
    ShiningMichal likes this.
  33. Aoedipus

    Aoedipus

    Joined:
    Jan 31, 2019
    Posts:
    25
    For what it's worth, this test code block (which is attempting to copy scripts from one player character gameObject to another in an Awake function) caused it:

    Code (CSharp):
    1.  
    2. MonoBehaviour[] scriptList = obj1.GetComponents<MonoBehaviour>();
    3. GameObject swapChar = GameObject.Find("obj2");
    4.  
    5. foreach (MonoBehaviour script in scriptList)
    6. {
    7.     swapChar.AddComponent(script.GetType());
    8.     System.Reflection.FieldInfo[] fields = script.GetType().GetFields();
    9.     foreach (System.Reflection.FieldInfo field in fields)
    10.     {
    11.         field.SetValue(swapChar.GetComponent(script.GetType()), field.GetValue(script));
    12.     }
    13. }
    14.  
     
  34. Gaspedal

    Gaspedal

    Joined:
    Mar 29, 2009
    Posts:
    376
    Yes, I can confirm it. I get the same error message (after building), since I have added a new Layer to my Terrain (now 5 Layers). Unity 2021.1.22f1
    After the error message, Unity is very slow and I can't work. I have to restart it each time. With only 4 layers n Terrain it works fine.
     
    Last edited: Jul 28, 2022
  35. cshelton73

    cshelton73

    Joined:
    Jul 14, 2015
    Posts:
    2
    Google Tags: 2022, 2021.2.7f1, Allocation of bytes at, Me too

    TLDR for 2 year old thread:

    1. This error can be caused by many things, is obscure and hard to repro.
    2. Try to limit your terrain to 4 layers if you have terrain in your project. (Solution 1)
    3. Turn off "Selection Outline" in the Gizmos menu (Upper far right in your scene window). (Solution 2)
    4. Various reports regarding the Collaboration window as the cause for some (Search this thread for details)
    5. Reimport all of your assets. (Temporary solution that worked for some amount of time for some people)
    6. Close and restart Unity. (Temporary solution)
    7. If you have a 100% repro case to make this happen, please submit a bug with your steps and project files.
    8. If you have some idea of how this bug occurred for you, please post it here. Ideas in this thread have led to solutions.
    9. If you've found something that fixes this error for you, please post it here as it might be the fix for someone else as well.
     
    KarlKarl2000 and Develeone like this.
  36. DSivtsov

    DSivtsov

    Joined:
    Feb 20, 2019
    Posts:
    151
    IN-15396 2020.3.34f1 Big number of messages like as "Allocation of bytes at"
    May be it will be useful for anybody:
    After comment the added methods and restart problem is gone.
    One time additionally I received the message after restart:
    "UnityException: ToString is not allowed to be called during serialization, call it from OnEnable instead. Called from ScriptableObject 'LevelSO'.
    See "Script Serialization" page in the Unity Manual for further details."
     
  37. unity_0ashimpoudel

    unity_0ashimpoudel

    Joined:
    May 16, 2021
    Posts:
    1
    In my case .I found it to occur when i was using recursive function .And also when something is moving towards infinity
    i printed the number of times ,recursive function was being called which caused program to stop and gave me this error
     
  38. tradredouaned3

    tradredouaned3

    Joined:
    Nov 24, 2021
    Posts:
    1
    I have the same problem, it came exactly after removing "RTS camera assets" that i got from asset store, i have a weak PC so these messages are Pain in the ACE
     
  39. Lord_Legion

    Lord_Legion

    Joined:
    Dec 30, 2020
    Posts:
    7
    I just wrote a Debug.Log, after which this error appeared. I solved it by reverting my commit
     
  40. Nichathan

    Nichathan

    Joined:
    Mar 8, 2020
    Posts:
    23
    Still happening 2021.3.16f1, with no reason. I created a new project, added an image, wrote a script, returned to Unity and it started to happen.

    At the aggressive and underpaid Unity employee's request, I submitted a bug report but it isn't posting so I bet it will continue showing up for the next 3 years.
     
  41. lilpophill

    lilpophill

    Joined:
    Jun 27, 2021
    Posts:
    1
    I solved this problem by removing the animation rigging package, check what you imported into the project, maybe this causes an error
     
  42. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    Locking this thread as there seems to be some confusion around generic errors that seem similar, but aren't the same.
     
Thread Status:
Not open for further replies.