- Home /
Unity Editor Memory Spike Generic List
I'm using a public generic list of sprites. When I first open Unity, it has about 150,000k memory usage. If I open my list in the inspector which has 120 elements, memory usage jumps to 1,000,000k and never comes down again, even after closing the list. If I try to add elements to the list by dragging from assets, memory usage jumps to 1,200,000k and Unity stops responding unless shut down. Sometimes the elements are added, sometimes not. I've been adding elements to the list in batches and then shutting down.
This behaviour began after the first 42 items. Is this behaviour normal for a list of this size? Am I using a generic list poorly? What are my alternatives?
Never heard about that. Just to be sure:
You work entirely in edit mode, not in play mode?
It's an ordinary generic List of type Sprite?
You don't have any kind of custom inspector editor script for the class that contains the List field?
$$anonymous$$ay i ask how much memory your hardware provides? Which operating system do you use(win, mac, linux)? 32bit / 64bit?
Unity uses the $$anonymous$$ono framework which has it's own memory management system. It has to aquire chunks of memory from the operating system if the currently used memory isn't enough. Those are usually not be freed, even when they aren't be in use.
$$anonymous$$aybe have a look at the system requirements over here. However they don't mention a $$anonymous$$imum or recommended memory amount since it mostly depends on the complexity of your project.
Attempting to run Unity with 2GB RA$$anonymous$$ will leave you in a state of anger and frustration. Do not under any circumstances throw your laptop across the room. Although it will instantly make your list consume less RA$$anonymous$$, this effect may be permanent.
This is entirely in edit mode after initially opening Unity. It's an ordinary generic list of type Sprite built with:
public List<Sprite> cardSpriteList = new List<Sprite>();
... And then dragging sprite assets from assets to inspector.
No custom inspectors (it's a fairly new project with only one script).
Running Windows 7 x64 on a PC with 6GB RA$$anonymous$$.
Your answer
![](https://koobas.hobune.stream/wayback/20220612040110im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Can Unity not replace customized values on re-imported packages? 0 Answers
Inspector turns black on refresh 4 Answers
What should be handled in the custom inspector version of a script? 1 Answer
How to specify the rotation angle in degrees, in the inspector? 2 Answers
How to record hideFlags for Undo/Redo 0 Answers