I just created a new URP sample project for testing and by placing just one TextMeshPro on scene memory leak started to form. My RAM is being eaten at rate of 10-70 mb/s, which is insane. For example memory profiler showed a 365 mb difference in just 23 seconds in untracked private field
Why could this happen and what am I supposed to do?
Update 1:
It seems it has something to do with rendering, since the problem disappears when disabling MeshRenderer on TMPro object
Update 2:
It seems it has something to do with rendering not only TMPro, but almost anything in general
Update 3:
To be specific, thereās no need to enter playmode, it will occur in āedit timeā
Only temporary solution I found is using Wireframe rendering in scene view and closing all other scene and game tabs. Though I need more test to confirm this method, I will mark this message as solution in next 12 hours if it really helps!
You are on the latest patch release 6000.2.8f1? If not, try updating, it may be an issue thatās already fixed. And try confirm the issue exists in a blank project, if so, thatāll be ideal for a bug report.
Yeah, I am on a lastest version and I confirmed this issue by creating empty project, it starts leaking memory as soon as I place TextMesh Pro on scene. It becomes trickier with other objects, but by placing some stuff, like objects with transparent materials or vfx graph samples. I tried on other machine and got the same result. I found another laptop, installed unity and got the same result. I also tried to downgrade project to previous version, but every lest one down to the 6.2 security fix has this
Be sure to delete the /Library before a downgrade, and then make a project backup. Downgrading is not supported and can lead to loss of data. Going down a few patch releases within the same major.minor version is usually without issues but you never know.
If the 6.1.8f1 works for you thatās good, just donāt publish new builds with that version and eventually test again with the then-latest (not: ālastestā ) patch release. Thereās usually one published every two weeks for each major.minor version.
I have the same problem, see the same thing in the Memory Profiler. When I reach 99% memory used, Unity crashes. It took my computer with it at first till I submitted a bug report (challenging: I had to be quick to get it sent before the computer crashed) and got back instructions for changing nVidia settings (I did a clean install and reset to defaults which seem to be good) and removing āgame barā and āgame overlayā programs (that I never installed anywayā¦but that doesnāt keep them from being thereā¦) but that only prevents the system from rebooting. It still leaks and crashes Unity. And my system runs REALLY SLOW for a couple minutes afterward (better than a reboot), so that opening Task Manager, for ex., takes a while. If I can manage to get logged out and log back in, that brings it all back to normal.
Could you submit a bug report with what you know? It would be amazing if Unity didnāt know about this already butā¦Iāve seen more amazing things.
Edit: for me, Unity 6.2.8f1, big project and had no idea what was wrong, every package latest version, uninstalled some unneeded ones, I use Jetbrains Rider (pro, latest version) and Aron Granbergās A* Pathfinding Pro and wondered if that was it, but maybe not.
@deplorablemountaineer
I have submited a bug report, and yeah, almost everything you say matches my situation very precisely. Seems like Unity has some kind of a weird leaking bug that have been around for quite a while and is really situational, hope they will fix it soon!
Hello, Iām having the same issue on my project, Iām using version 6000.2.6f2 .
I was showing dmg using tmpro and I had to disable it to be able to keep working on my game, otherwise after playing for a few minutes I had already filled my 32gb of ram.
Hmm, iām just curious guys, what led you to choose a non LTS version?
Donāt get me wrong, Unity has bunged a few LTSās and some issues have persisted across several LTSā before they ever recieved fixes, but in my experience, using anything but an LTS is almost asking for issues.
Especially the latest āRecommendedā version. I honestly believe Unity should stop recommending those versions. Post after post, all i see is user issues.
Anyways, GL in finding resolution, and Get Your Game On!
@Homicide, Hey, sorry for late response, but there are two main reasons to use lastest versions:
someone has to find bugs for them to become better
they sometimes contain crucial fixes or new features.
Though I agree with you, I think they should probably make Latest (really the newest version), Recommended (pretty stable one from recent versions) and LTS tabs in Hub
I have experienced this as a memory leak in unmanaged memory when SkinnedMeshRenders are enabled at runtime. Fills up memory on the system till crash. Memory does not release until open/close of the editor.
The bug started in 6000.2.5f1.
I ended up rolling back to 6000.2.4f1 and no more leak.
Disabling the SkinnedMeshRenders at runtime on the objects stops the memory leak. (also stops rendering the object) Also watch out for the 6000.2.4f1 is an insecure version.
yeah despite such a simple thing to replicate, new project, new scene in urp, drop tmp text item.. run.. i mean.. sometimes i have to wonder how the tests are done, cos so many times it seems they cant reproduce anything.. no matter how simple.
Hello
I spent a lot of time trying to reproduce this. I am using Unity 6.2 6000.2.6f1
I narrowed it down to the following:
A visual effect component on an otherwise empty game object will cause a 300mb per second (until crash) memory leak.
It will do this in the Scene view in editor.
This will happen even when in Wireframe mode
It will do this only if the camera (read as: the scene view perspective, AKA what you see in the Scene window, not an actual camera) is far away.
The visual effect also needs to be near a mesh.
I understand that this last one is not very clear - I canāt narrow it down further than that. if you drag the object containing the visual effect component far away from other objects and attempt to recreate this error, you wont get it.
I trimmed down my scene to a point where this effect occurs 100% of the time across sessions
Things to note:
-The visual effect component doesnāt matter. It can be a freshly added component with no changes and this error will occur.
-If the Visual effect component is the only thing in the scene, this bug will not occur
-The visual effect doesnāt need to have an asset template. Empty or not, the bug occurs.
-As far as I can tell, the data/properties on the Visual effect component donāt matter. It occurs with a freshly added component with no changes.
I will most likely just downgrade to another version.
If anyone has weird memory leaks in editor-mode, itās most likely this
hello, hope you are doing well today
i have compiled a scene and sent out a bug report. i have tried to include as many details as i could. please reach out to me if you need anything else.
the bug report is named:
āIN-137372 - Huge Memory Leak (300mb/s) when using Visual Effect component in Editor modeā