performance issues

There are so many problems that are discouraging.
Well, if someone who understands or knows what’s going on can give me some tips, sometimes in playmode it takes a lot like 5-10 minutes or more waiting



In your above screenshot there are literally 4 million calls to the garbage collector. You have over one GIGABYTE of garbage to collect. What exactly are you doing / loading that may cause this? Garbage is created by dead references. These dont just vanish when you set them null or something, so the garbage collector needs to collect them eventually. This happens automatically. However, i have no idea what could cause these many calls or this much garbage to be necessary. Are you perhaps loading tons of files, images, videos, or anything of that sort?

Generally it would help if we knew what you did.

Well, the only thing I have in this scene is (12menu ) one for each character.
which makes up 12 customizable characters in which each has about 250 objects.

but each character in total when being customized has only 15 active objects in each.
does it interfere a lot?

When you say you have 12 customizable character, i assume you are loading all the customizables and then later discard them? That may be causing your 1GB garbage. But i dont think there should be 4 million calls. Anyways, what i’m doing right now is only guessing. I’m not an expert on GC, but definitely never had problems like these. Maybe someone else can tell you what’s wrong with your approach given the limited information, but otherwise i guess we’d need to see some of the code causing this.

If you’re referencing the assets in the scene for all 250 X 12 objects, then they are all loaded when the scene starts. Doesn’t matter if they are active or not. 3,000 models, textures, or whatever these objects are might be a lot or might not. I’m curious what your memory usage is though. If this is the source of the problem you might consider using an additive scene approach or Resources.Load so you can load just what you need when you need it.

Is there any possibility to see which script or what is sending this amount of garbage to gc through the profiler or something?

My project consumes 1gb of memory.

tell me one thing, if i had only 1 prefab of my characters and multiply it by 10, would it be lighter than i had 10 prefab one for each one, or will it be the same since i would be multiplying by any way?

about resource.load and addtive, would be a loading to load these objects?

Splitting your content across multiple prefabs doesn’t change anything if you are going to reference all 10 of those prefabs in the scene. When a scene loads it goes through every reference, and everything that reference references, in the entire scene and loads all assets before the first frame. It can be 1 prefab, 10 prefabs, split across 100 prefabs, doesn’t matter if you’re just going to reference all of them in the scene and they all reference the same set of 3,000 or so assets. They are all getting loaded.

How you avoid that is you just don’t reference the prefabs in the scene you’re loading. You could conceivably create 12 scenes, each for 1 of your characters, and all you reference in that scene is the 1 character prefab with only its assets. Then when you need to load that character you additive load that scene. When you want to switch characters, you unload that character scene and load the new one. I don’t know if doing it that way is a particularly great idea, but it could be done that way.

Resources.Load gets more granular, where you could load or unload the individual assets as needed. I’ve never really used it, but I know it often gets used when you have a large number of assets you need to choose from but only need a small number loaded at any given time, which sounds like your case.

Hi
Joe-Censored
, I saw that some things that appeared here I have the same problems.
I realize that the UI is allocating a lot of junk, after deleting it softened a lot, but my project’s memory was at 300mb after deleting them, my interface went to 800mb, could you tell me why?

Unfortunately I’d only be guessing. An example guess is I don’t believe Unity stores various assets, such as images or audio assets, in memory using the same format they are stored on disk. So something in a highly compressed format on disk can take up considerably more memory at runtime.